Skip to content

Commit

Permalink
style: adjust divider colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-1979 committed Oct 24, 2024
1 parent 7359368 commit e719954
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function LabelBalancePrice ({ address, balances, label, onClick,
</Grid>
</Grid>
{showLabel &&
<Divider sx={{ bgcolor: 'secondary.main', height: '1px', my: '5px' }} />
<Divider sx={{ bgcolor: 'divider', height: '1px', my: '5px' }} />
}
</>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-polkagate/src/popup/account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export default function AccountDetails (): React.ReactElement {
onClick={goToOthers}
sx={{ p: 0 }}
>
<ArrowForwardIosRoundedIcon sx={{ color: 'secondary.light', fontSize: '26px', stroke: theme.palette.secondary.light, strokeWidth: 1 }} />
<ArrowForwardIosRoundedIcon sx={{ color: 'secondary.light', fontSize: '26px', stroke: theme.palette.secondary.light, strokeWidth: 0 }} />
</IconButton>
</Grid>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function LockedInReferenda ({ address, refresh, setRefresh }: Pro
</Grid>
</Grid>
</Grid>
<Divider sx={{ bgcolor: 'secondary.main', height: '1px', my: '5px' }} />
<Divider sx={{ bgcolor: 'divider', height: '1px', my: '5px' }} />
{showReview && !!classToUnlock?.length && api && lockedInRef && unlockableAmount && address &&
<Review
address={address}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface Props {
setBgImage: React.Dispatch<React.SetStateAction<string | undefined>>
}

export default function AiBackgroundImage({ bgImage, setBgImage }: Props): React.ReactElement {
export default function AiBackgroundImage ({ bgImage, setBgImage }: Props): React.ReactElement {
const { t } = useTranslation();
const theme = useTheme();
const imgRef = useRef({ dark: 0, light: 0 });
Expand Down
11 changes: 4 additions & 7 deletions packages/extension-polkagate/src/popup/staking/pool/Info.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// Copyright 2019-2024 @polkadot/extension-polkagate authors & contributors
// SPDX-License-Identifier: Apache-2.0
// @ts-nocheck

/* eslint-disable react/jsx-max-props-per-line */

//@ts-nocheck

import type { PoolStakingConsts } from '../../../util/types';

import { Container, Divider, Grid } from '@mui/material';
Expand All @@ -26,15 +23,15 @@ interface Props {

}

export default function Info({ address, info, setShowInfo, showInfo }: Props): React.ReactElement {
export default function Info ({ address, info, setShowInfo, showInfo }: Props): React.ReactElement {
const { t } = useTranslation();
const { decimal, token } = useInfo(address);

const onBackClick = useCallback(() => {
setShowInfo(false);
}, [setShowInfo]);

const Row = ({ label, showDivider = true, value }: { label: string, value: BN | undefined, showDivider?: boolean }) => {
const Row = ({ label, showDivider = true, value }: { label: string, value: BN | string | number | undefined, showDivider?: boolean }) => {
return (
<>
<Grid alignItems='center' container justifyContent='space-between' p='5px 15px'>
Expand All @@ -50,7 +47,7 @@ export default function Info({ address, info, setShowInfo, showInfo }: Props): R
</Grid>
{showDivider &&
<Grid container item justifyContent='center' xs={12}>
<Divider sx={{ bgcolor: 'secondary.main', m: '1px auto', width: '90%' }} />
<Divider sx={{ bgcolor: 'divider', m: '1px auto', width: '90%' }} />
</Grid>
}
</>
Expand All @@ -70,7 +67,7 @@ export default function Info({ address, info, setShowInfo, showInfo }: Props): R
</Grid>
{showDivider &&
<Grid container item justifyContent='center' xs={12}>
<Divider sx={{ bgcolor: 'secondary.main', m: '1px auto', width: '90%' }} />
<Divider sx={{ bgcolor: 'divider', m: '1px auto', width: '90%' }} />
</Grid>
}
</>
Expand Down
16 changes: 7 additions & 9 deletions packages/extension-polkagate/src/popup/staking/pool/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019-2024 @polkadot/extension-polkagate authors & contributors
// SPDX-License-Identifier: Apache-2.0
// @ts-nocheck

/* eslint-disable react/jsx-max-props-per-line */

Expand Down Expand Up @@ -72,7 +71,7 @@ export default function Index(): React.ReactElement {

const staked = useMemo(() => pool === undefined ? undefined : new BN(pool?.member?.points ?? 0), [pool]);
const claimable = useMemo(() => pool === undefined ? undefined : new BN(pool?.myClaimable ?? 0), [pool]);
const isPoolInfoOutdated = useMemo(() => pool && pool.date && (Date.now() - pool.date) > BALANCES_VALIDITY_PERIOD, [pool]);
const isPoolInfoOutdated = useMemo(() => pool?.date && (Date.now() - pool.date) > BALANCES_VALIDITY_PERIOD, [pool]);

const [redeemable, setRedeemable] = useState<BN | undefined>(state?.redeemable);
const [unlockingAmount, setUnlockingAmount] = useState<BN | undefined>(state?.unlockingAmount);
Expand All @@ -96,19 +95,19 @@ export default function Index(): React.ReactElement {
const _toggleShowUnlockings = useCallback(() => setShowUnlockings(!showUnlockings), [showUnlockings]);

useEffect(() => {
api && api.derive.session?.progress().then((sessionInfo) => {
api?.derive.session?.progress().then((sessionInfo) => {
setSessionInfo({
currentEra: Number(sessionInfo.currentEra),
eraLength: Number(sessionInfo.eraLength),
eraProgress: Number(sessionInfo.eraProgress)
});
});
}).catch(console.error);
}, [api]);

useEffect((): void => {
api && api['query']['staking'] && api.query['staking']['currentEra']().then((ce) => {
api?.query['staking']?.['currentEra']().then((ce) => {
setCurrentEraIndex(Number(ce));
});
}).catch(console.error);
}, [api]);

useEffect(() => {
Expand Down Expand Up @@ -218,8 +217,7 @@ export default function Index(): React.ReactElement {
</Grid>
);

const Row = ({ isUnstaking, label, link1Text, link2Text, onLink1, onLink2, showDivider = true, value }
: { label: string, value: BN | undefined, link1Text?: Text, onLink1?: () => void, link2Text?: Text, onLink2?: () => void, showDivider?: boolean, isUnstaking?: boolean }) => {
const Row = ({ isUnstaking, label, link1Text, link2Text, onLink1, onLink2, showDivider = true, value }: { label: string, value: BN | undefined, link1Text?: Text, onLink1?: () => void, link2Text?: Text, onLink2?: () => void, showDivider?: boolean, isUnstaking?: boolean }) => {
return (
<>
<Grid alignItems='center' container justifyContent='space-between' pt='10px'>
Expand Down Expand Up @@ -274,7 +272,7 @@ export default function Index(): React.ReactElement {
}
{showDivider &&
<Grid container item justifyContent='center' xs={12}>
<Divider sx={{ bgcolor: 'secondary.main', mt: '10px', width: '100%' }} />
<Divider sx={{ bgcolor: 'divider', mt: '10px', width: '100%' }} />
</Grid>
}
</>
Expand Down
5 changes: 2 additions & 3 deletions packages/extension-polkagate/src/popup/staking/solo/Info.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2019-2024 @polkadot/extension-polkagate authors & contributors
// SPDX-License-Identifier: Apache-2.0
// @ts-nocheck

/* eslint-disable react/jsx-max-props-per-line */

Expand All @@ -23,7 +22,7 @@ interface Props {
setShowInfo: React.Dispatch<React.SetStateAction<boolean>>
}

export default function Info({ address, info, setShowInfo, showInfo }: Props): React.ReactElement {
export default function Info ({ address, info, setShowInfo, showInfo }: Props): React.ReactElement {
const { t } = useTranslation();
const minimumActiveStake = useMinToReceiveRewardsInSolo(address);
const token = useToken(address);
Expand All @@ -49,7 +48,7 @@ export default function Info({ address, info, setShowInfo, showInfo }: Props): R
</Grid>
{showDivider &&
<Grid container item justifyContent='center' xs={12}>
<Divider sx={{ bgcolor: 'secondary.main', m: '1px auto', width: '90%' }} />
<Divider sx={{ bgcolor: 'divider', m: '1px auto', width: '90%' }} />
</Grid>
}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export default function Index (): React.ReactElement {
}
{showDivider &&
<Grid container item justifyContent='center' xs={12}>
<Divider sx={{ bgcolor: 'secondary.main', m: '2px auto', width: '100%' }} />
<Divider sx={{ bgcolor: 'divider', m: '2px auto', width: '100%' }} />
</Grid>
}
</>
Expand Down

0 comments on commit e719954

Please sign in to comment.