Skip to content

Commit

Permalink
be quiet linter
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyv1987 committed Oct 26, 2023
1 parent 84f6459 commit c3d62b2
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions nym-wallet/src/components/Rewards/RewardsSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@ import { useTheme } from '@mui/material/styles';
import { useDelegationContext } from 'src/context/delegations';
import { InfoTooltip } from '../InfoToolTip';

const RewardSummaryField = ({
title,
value,
Tooltip,
isLoading,
}: {
title: string;
value: string;
Tooltip?: React.ReactNode;
isLoading?: boolean;
}) => {
const breakpoint = useMediaQuery(useTheme().breakpoints.down('xl'));
const alignProps: { gap: number; direction: StackProps['direction'] } = {
gap: breakpoint ? 0 : 1,
direction: breakpoint ? 'column' : 'row',
};

return (
<Stack {...alignProps} alignItems="start">
<Stack direction="row" alignItems="center" gap={1}>
{Tooltip}
<Typography>{title}:</Typography>
</Stack>
<Typography fontWeight={600} fontSize={16} textTransform="uppercase">
{isLoading ? <CircularProgress size={16} /> : value}
</Typography>
</Stack>
);
};

export const RewardsSummary: FCWithChildren<{
isLoading?: boolean;
totalDelegation?: string;
Expand Down Expand Up @@ -39,33 +69,3 @@ export const RewardsSummary: FCWithChildren<{
</Stack>
);
};

const RewardSummaryField = ({
title,
value,
Tooltip,
isLoading,
}: {
title: string;
value: string;
Tooltip?: React.ReactNode;
isLoading?: boolean;
}) => {
const breakpoint = useMediaQuery(useTheme().breakpoints.down('xl'));
const alignProps: { gap: number; direction: StackProps['direction'] } = {
gap: breakpoint ? 0 : 1,
direction: breakpoint ? 'column' : 'row',
};

return (
<Stack {...alignProps} alignItems="start">
<Stack direction="row" alignItems="center" gap={1}>
{Tooltip}
<Typography>{title}:</Typography>
</Stack>
<Typography fontWeight={600} fontSize={16} textTransform="uppercase">
{isLoading ? <CircularProgress size={16} /> : value}
</Typography>
</Stack>
);
};

0 comments on commit c3d62b2

Please sign in to comment.