Skip to content

Commit

Permalink
Refactor SwapCard component to simplify description rendering logic
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinciarka committed Sep 18, 2024
1 parent cef220c commit 9517d29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions features/sky/components/SwapCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ export const SwapCardWrapper = ({
sx={{ cursor: 'pointer' }}
/>
</Flex>
{config.descriptionPrimary && config.descriptionSecondary && (
{config.description && (
<Box sx={{ pt: 1, pb: 4 }}>
<Text variant="paragraph4" color="neutral80">
{!isTokenSwapped ? config.descriptionPrimary : config.descriptionSecondary}
{config.description}
</Text>
</Box>
)}
Expand Down
10 changes: 4 additions & 6 deletions features/sky/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export const skySwapTokensConfig = [
secondaryTokenAddress: mainnetContracts.tokens['USDS'].address,
contractAddress: mainnetContracts.sky.daiusds.address,
stake: false,
descriptionPrimary: '',
descriptionSecondary: '',
description:
'Upgrade DAI to USDS and unlock features of the Sky Ecosystem, like sUSDS and SKY rewards.',
},
{
primaryToken: 'MKR',
Expand All @@ -18,17 +18,15 @@ export const skySwapTokensConfig = [
secondaryTokenAddress: mainnetContracts.tokens['SKY'].address,
contractAddress: mainnetContracts.sky.mkrsky.address,
stake: false,
descriptionPrimary: '',
descriptionSecondary: '',
description: 'Upgrade MKR to SKY for a 24,000 for 1 token split, and eligibility for rewards.',
},
{
primaryToken: 'USDS',
secondaryToken: 'SUSDS',
primaryTokenAddress: mainnetContracts.tokens['USDS'].address,
secondaryTokenAddress: mainnetContracts.tokens['SUSDS'].address,
contractAddress: mainnetContracts.sky.susds.address,
descriptionPrimary: '',
descriptionSecondary: '',
description: 'Stake USDS to save and earn a competitive yield.',
stake: true,
},
]

0 comments on commit 9517d29

Please sign in to comment.