Skip to content

Commit

Permalink
fix(suite): Fix staking cards (#14376)
Browse files Browse the repository at this point in the history
(cherry picked from commit da374a4)
  • Loading branch information
jvaclavik authored and MiroslavProchazka committed Sep 17, 2024
1 parent e4ee395 commit bcf94e4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTheme } from 'styled-components';
import { Card, Icon } from '@trezor/components';
import { Card, Column, Icon } from '@trezor/components';
import { Translation } from 'src/components/suite';
import { AccentP, CardBottomContent, GreyP } from './styled';

Expand All @@ -12,14 +12,16 @@ export const ApyCard = ({ apy }: ApyCardProps) => {

return (
<Card paddingType="small">
<Icon name="percent" color={theme.iconSubdued} />
<Column alignItems="flex-start">
<Icon name="percent" color={theme.iconSubdued} />

<CardBottomContent>
<AccentP>{`${apy}%`}</AccentP>
<GreyP>
<Translation id="TR_STAKE_APY" />
</GreyP>
</CardBottomContent>
<CardBottomContent>
<AccentP>{`${apy}%`}</AccentP>
<GreyP>
<Translation id="TR_STAKE_APY" />
</GreyP>
</CardBottomContent>
</Column>
</Card>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo } from 'react';
import { BigNumber } from '@trezor/utils/src/bigNumber';
import { useTheme } from 'styled-components';
import { Card, Icon } from '@trezor/components';
import { Card, Column, Icon } from '@trezor/components';
import { Translation } from 'src/components/suite';
import { AccentP, CardBottomContent, GreyP } from './styled';
import { selectSelectedAccount } from 'src/reducers/wallet/selectedAccountReducer';
Expand Down Expand Up @@ -38,23 +38,25 @@ export const PayoutCard = ({

return (
<Card paddingType="small">
<Icon name="calendar" color={theme.iconSubdued} />

<CardBottomContent>
<AccentP>
{payout === undefined ? (
<Translation
id="TR_STAKE_MAX_REWARD_DAYS"
values={{ count: BACKUP_REWARD_PAYOUT_DAYS }}
/>
) : (
<Translation id="TR_STAKE_DAYS" values={{ count: payout }} />
)}
</AccentP>
<GreyP>
<Translation id="TR_STAKE_NEXT_PAYOUT" />
</GreyP>
</CardBottomContent>
<Column alignItems="flex-start">
<Icon name="calendar" color={theme.iconSubdued} />

<CardBottomContent>
<AccentP>
{payout === undefined ? (
<Translation
id="TR_STAKE_MAX_REWARD_DAYS"
values={{ count: BACKUP_REWARD_PAYOUT_DAYS }}
/>
) : (
<Translation id="TR_STAKE_DAYS" values={{ count: payout }} />
)}
</AccentP>
<GreyP>
<Translation id="TR_STAKE_NEXT_PAYOUT" />
</GreyP>
</CardBottomContent>
</Column>
</Card>
);
};

0 comments on commit bcf94e4

Please sign in to comment.