Convert spinner to data uri (#8968)

* Convert spinner to data uri

* Fix header
This commit is contained in:
Jaco 2023-02-07 10:21:49 +02:00 committed by GitHub
parent db18db7bfd
commit 29378fb591
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
// Copyright 2017-2023 @polkadot/app-staking authors & contributors
// Copyright 2017-2023 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React from 'react';
@ -14,11 +14,6 @@ interface Props {
variant?: 'app' | 'appPadded' | 'cover' | 'push' | 'mini';
}
// prefetch
const img = new Image();
img.src = spinnerSrc as string;
function Spinner ({ className = '', label, noLabel, variant = 'app' }: Props): React.ReactElement<Props> | null {
const { t } = useTranslation();
@ -26,7 +21,7 @@ function Spinner ({ className = '', label, noLabel, variant = 'app' }: Props): R
<StyledSpinner className={`${className} ui--Spinner variant-${variant}`}>
<img
className={variant === 'push' ? '' : 'highlight--bg highlight--border'}
src={spinnerSrc as string}
src={spinnerSrc}
/>
{!noLabel && variant.startsWith('app') && <div className='text'>{label || t<string>('Retrieving data')}</div>}
</StyledSpinner>