diff --git a/src/pages/stakingPage/components/RewardsCard.tsx b/src/pages/stakingPage/components/RewardsCard.tsx index 65ba5c7..7a8df88 100644 --- a/src/pages/stakingPage/components/RewardsCard.tsx +++ b/src/pages/stakingPage/components/RewardsCard.tsx @@ -7,8 +7,6 @@ import { EthLogo } from '@/components/commons/Logo/EthLogo'; import { AssetPriceResponse } from '@/types/api'; import { claim, compound } from '@/web3Config/staking/hooks'; -import { useVesting } from '../hooks/useVesting'; - type RewardsCardProps = { data: { claimable: string; @@ -24,7 +22,6 @@ export const RewardsCard = ({ data, refetchData }: RewardsCardProps): JSX.Elemen const [isClaiming, setIsClaiming] = useState(false); const [isCompounding, setIsCompounding] = useState(false); const [grixPrice, setGrixPrice] = useState(null); - const { totalStaked } = useVesting(); const toast = useToast(); // Fetch GRIX price from CoinGecko @@ -113,65 +110,50 @@ export const RewardsCard = ({ data, refetchData }: RewardsCardProps): JSX.Elemen _hover={{ borderColor: 'gray.800' }} > - - - - - WETH - + + + + + + WETH Rewards + + + + + ≤{(0.0001).toFixed(4)} WETH + + + ≤${(0.01).toFixed(2)} + + - - ≤{(0.0001).toFixed(4)} WETH (≤${(0.01).toFixed(2)}) - - + - - - - - Claimable Rewards - - - - {data?.claimable ? Number(data.claimable).toFixed(4) : '0.0000'} esGRIX - {grixPrice && data?.claimable && ( - -  ($ - {(Number(data.claimable) * grixPrice).toLocaleString(undefined, { - minimumFractionDigits: 2, - maximumFractionDigits: 2, - })} - ) + + + + + + Claimable Rewards - )} - - - - - - - - Total Staked - - - - {Number(totalStaked).toLocaleString(undefined, { - minimumFractionDigits: 1, - maximumFractionDigits: 1, - })}{' '} - GRIX - {grixPrice && Number(totalStaked) > 0 && ( - -  ($ - {(Number(totalStaked) * grixPrice).toLocaleString(undefined, { - minimumFractionDigits: 2, - maximumFractionDigits: 2, - })} - ) + + + + {data?.claimable ? Number(data.claimable).toFixed(4) : '0.00'} esGRIX - )} - - + {grixPrice && data?.claimable && Number(data.claimable) > 0 && ( + + $ + {(Number(data.claimable) * grixPrice).toLocaleString(undefined, { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} + + )} + + + + @@ -167,7 +192,7 @@ export const StakeUnstakeModal: React.FC = ({ - + You might not be able to unstake your desired {isEsGrix ? 'esGRIX' : 'GRIX'} if there is an active vesting position. @@ -181,15 +206,35 @@ export const StakeUnstakeModal: React.FC = ({ isLoading={isApproving} loadingText="Approving" onClick={handleApprove} - bg="#2F6C60" + variant="solid" + bg="teal.500" color="white" - size="lg" + size="md" width="full" - height="48px" + height="40px" fontSize="sm" + fontWeight="500" isDisabled={!isAmountValid()} - _hover={{ bg: '#2A5F54' }} - _active={{ bg: '#264F46' }} + _hover={{ + bg: 'teal.600', + transform: 'translateY(-1px)', + boxShadow: 'md', + }} + _active={{ + bg: 'teal.700', + transform: 'translateY(0)', + }} + _disabled={{ + bg: 'gray.700', + color: 'gray.500', + cursor: 'not-allowed', + _hover: { + bg: 'gray.700', + transform: 'none', + boxShadow: 'none', + }, + }} + transition="all 0.2s" > Approve @@ -198,15 +243,35 @@ export const StakeUnstakeModal: React.FC = ({ isLoading={isLoading} loadingText={isStakeMode ? 'Staking' : 'Unstaking'} onClick={onSubmit} - bg="#2F6C60" + variant="solid" + bg="teal.500" color="white" - size="lg" + size="md" width="full" - height="48px" + height="40px" fontSize="sm" + fontWeight="500" isDisabled={!isAmountValid() || !amount} - _hover={{ bg: '#2A5F54' }} - _active={{ bg: '#264F46' }} + _hover={{ + bg: 'teal.600', + transform: 'translateY(-1px)', + boxShadow: 'md', + }} + _active={{ + bg: 'teal.700', + transform: 'translateY(0)', + }} + _disabled={{ + bg: 'gray.700', + color: 'gray.500', + cursor: 'not-allowed', + _hover: { + bg: 'gray.700', + transform: 'none', + boxShadow: 'none', + }, + }} + transition="all 0.2s" > {isStakeMode ? 'Stake' : 'Unstake'} diff --git a/src/pages/stakingPage/components/StakingCardContent.tsx b/src/pages/stakingPage/components/StakingCardContent.tsx index bd61414..4baf5e1 100644 --- a/src/pages/stakingPage/components/StakingCardContent.tsx +++ b/src/pages/stakingPage/components/StakingCardContent.tsx @@ -1,4 +1,4 @@ -import { Box, Button, Flex, Heading, HStack, SimpleGrid, Text, useDisclosure, VStack } from '@chakra-ui/react'; +import { Box, Button, Flex, HStack, SimpleGrid, Text, useDisclosure, VStack } from '@chakra-ui/react'; import React from 'react'; import { GrixLogo } from '@/components/commons/Logo'; @@ -70,69 +70,69 @@ export const StakingCardContent: React.FC = ({ return ( - - + +
- - - - + + {title} + +
- - - + + + Staked - + {formatBalance(stakedAmount)} - - + + Available to stake - + {formatBalance(availableBalance)} - - + + APR - - + + {apr.toFixed(2)}% - - + + Total Staked - - + + {Number(totalStakedInProtocol).toLocaleString(undefined, { - minimumFractionDigits: 1, - maximumFractionDigits: 1, + minimumFractionDigits: 2, + maximumFractionDigits: 2, })} {grixPrice && Number(totalStakedInProtocol) > 0 && ( - + ($ {(Number(totalStakedInProtocol) * grixPrice).toLocaleString(undefined, { minimumFractionDigits: 2, @@ -145,17 +145,18 @@ export const StakingCardContent: React.FC = ({ - -