diff --git a/packages/page-staking/src/Payouts/index.tsx b/packages/page-staking/src/Payouts/index.tsx index 4e16248419..625e1e22a4 100644 --- a/packages/page-staking/src/Payouts/index.tsx +++ b/packages/page-staking/src/Payouts/index.tsx @@ -98,7 +98,7 @@ function Payouts ({ className = '', isInElection }: Props): React.ReactElement

(api.query.staking.historyDepth, []); const stakerPayoutsAfter = useStakerPayouts(); - const { allRewards, isLoadingRewards } = useOwnEraRewards(!historyDepth || isPartialEras ? partialEras : historyDepth.toNumber()); + const { allRewards, isLoadingRewards } = useOwnEraRewards((!historyDepth || isPartialEras) ? partialEras : historyDepth.toNumber()); const { t } = useTranslation(); const isDisabled = isInElection || !isFunction(api.tx.utility?.batch); @@ -177,7 +177,9 @@ function Payouts ({ className = '', isInElection }: Props): React.ReactElement

('No pending payouts for your stashes')} - emptySpinner={t('Retrieving info for all applicable eras, this will take some time')} + emptySpinner={t('Retrieving info for last {{numEras}} eras, this will take some time', { + replace: { numEras: (!historyDepth || isPartialEras) ? partialEras : historyDepth.toNumber() } + })} footer={footer} header={headerStashes} isFixed diff --git a/packages/react-components/src/Icon.tsx b/packages/react-components/src/Icon.tsx index b577756d5c..25e168664b 100644 --- a/packages/react-components/src/Icon.tsx +++ b/packages/react-components/src/Icon.tsx @@ -12,16 +12,17 @@ interface Props { className?: string; color?: 'gray' | 'green' | 'normal' | 'orange' | 'red'; icon: IconName; + isSpinning?: boolean; onClick?: () => void; onMouseOut?: () => void; onMouseOver?: () => void; - size?: 'large'; + size?: '1x' | '2x'; } // one-time init of FA libraries library.add(fas); -function Icon ({ className = '', color = 'normal', icon, onClick, onMouseOut, onMouseOver, size }: Props): React.ReactElement { +function Icon ({ className = '', color = 'normal', icon, isSpinning, onClick, onMouseOut, onMouseOver, size = '1x' }: Props): React.ReactElement { return ( ); } diff --git a/packages/react-components/src/Spinner.tsx b/packages/react-components/src/Spinner.tsx index f2cd2ec9d6..03f193767c 100644 --- a/packages/react-components/src/Spinner.tsx +++ b/packages/react-components/src/Spinner.tsx @@ -3,10 +3,10 @@ // of the Apache-2.0 license. See the LICENSE file for details. import React from 'react'; -import Loader from 'semantic-ui-react/dist/commonjs/elements/Loader/Loader'; import styled from 'styled-components'; import { useTranslation } from './translate'; +import Icon from './Icon'; interface Props { className?: string; @@ -19,26 +19,34 @@ function Spinner ({ className = '', label, variant = 'app' }: Props): React.Reac return (
- + +
{variant === 'app' && ( label || t('Retrieving data') )} - +
); } export default React.memo(styled(Spinner)` + display: block; + margin: 0 auto; + text-align: center; + + .ui--Icon { + margin-bottom: 0.5rem; + opacity: 0.75; + } + .text { color: inherit !important; margin: 0 auto 1.5rem auto; opacity: 0.6; - text-align: center; } `); diff --git a/packages/react-components/src/Status/index.tsx b/packages/react-components/src/Status/index.tsx index 98832020f0..4d2dbe4896 100644 --- a/packages/react-components/src/Status/index.tsx +++ b/packages/react-components/src/Status/index.tsx @@ -231,13 +231,6 @@ export default React.memo(styled(Status)` vertical-align: middle; position: relative; - .ui--highlight--spinner { - &:after { - border-color: #fff transparent transparent !important; - font-size: 1rem; - } - } - .desc { flex: 1; overflow: hidden; diff --git a/packages/react-components/src/styles/index.ts b/packages/react-components/src/styles/index.ts index fdb4e6a4ad..48d374e669 100644 --- a/packages/react-components/src/styles/index.ts +++ b/packages/react-components/src/styles/index.ts @@ -54,12 +54,6 @@ export default createGlobalStyle` } } - .ui--highlight--spinner { - &:after { - border-color: ${getHighlight} transparent transparent !important; - } - } - .ui--highlight--stroke { stroke: ${getHighlight} !important; }