From 9cfc97e056df9a349e1bca4f12d101d9a3917da5 Mon Sep 17 00:00:00 2001 From: asalef10 Date: Tue, 10 Jun 2025 12:09:34 +0300 Subject: [PATCH 1/7] Refactor RewardsCard component by removing total staked display section --- .../stakingPage/components/RewardsCard.tsx | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/pages/stakingPage/components/RewardsCard.tsx b/src/pages/stakingPage/components/RewardsCard.tsx index 65ba5c7..e97c7a1 100644 --- a/src/pages/stakingPage/components/RewardsCard.tsx +++ b/src/pages/stakingPage/components/RewardsCard.tsx @@ -147,31 +147,7 @@ export const RewardsCard = ({ data, refetchData }: RewardsCardProps): JSX.Elemen - - - - - Total Staked - - - - {Number(totalStaked).toLocaleString(undefined, { - minimumFractionDigits: 1, - maximumFractionDigits: 1, - })}{' '} - GRIX - {grixPrice && Number(totalStaked) > 0 && ( - -  ($ - {(Number(totalStaked) * grixPrice).toLocaleString(undefined, { - minimumFractionDigits: 2, - maximumFractionDigits: 2, - })} - ) - - )} - - + @@ -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'} From 01a23479d06fdb0c950c5bfa7765f40385f7cce8 Mon Sep 17 00:00:00 2001 From: asalef10 Date: Tue, 10 Jun 2025 13:06:03 +0300 Subject: [PATCH 6/7] lint --- src/pages/stakingPage/components/RewardsCard.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/stakingPage/components/RewardsCard.tsx b/src/pages/stakingPage/components/RewardsCard.tsx index 6ab10f2..82cc12a 100644 --- a/src/pages/stakingPage/components/RewardsCard.tsx +++ b/src/pages/stakingPage/components/RewardsCard.tsx @@ -7,7 +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: { From d35f8455f9392fa11625cb49e77706cdfa65708c Mon Sep 17 00:00:00 2001 From: asalef10 Date: Tue, 10 Jun 2025 13:13:32 +0300 Subject: [PATCH 7/7] lint --- .../stakingPage/components/RewardsCard.tsx | 4 +-- .../components/StakeUnstakeModal.tsx | 32 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/pages/stakingPage/components/RewardsCard.tsx b/src/pages/stakingPage/components/RewardsCard.tsx index 82cc12a..7a8df88 100644 --- a/src/pages/stakingPage/components/RewardsCard.tsx +++ b/src/pages/stakingPage/components/RewardsCard.tsx @@ -7,7 +7,6 @@ import { EthLogo } from '@/components/commons/Logo/EthLogo'; import { AssetPriceResponse } from '@/types/api'; import { claim, compound } from '@/web3Config/staking/hooks'; - type RewardsCardProps = { data: { claimable: string; @@ -144,7 +143,8 @@ export const RewardsCard = ({ data, refetchData }: RewardsCardProps): JSX.Elemen {grixPrice && data?.claimable && Number(data.claimable) > 0 && ( - ${(Number(data.claimable) * grixPrice).toLocaleString(undefined, { + $ + {(Number(data.claimable) * grixPrice).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2, })} diff --git a/src/pages/stakingPage/components/StakeUnstakeModal.tsx b/src/pages/stakingPage/components/StakeUnstakeModal.tsx index 2ebab91..9ea2171 100644 --- a/src/pages/stakingPage/components/StakeUnstakeModal.tsx +++ b/src/pages/stakingPage/components/StakeUnstakeModal.tsx @@ -162,11 +162,11 @@ export const StakeUnstakeModal: React.FC = ({ borderColor: hasBalance ? 'gray.500' : 'gray.600', color: hasBalance ? 'white' : 'gray.300', transform: hasBalance ? 'translateY(-1px)' : 'none', - boxShadow: hasBalance ? 'sm' : 'none' + boxShadow: hasBalance ? 'sm' : 'none', }} _active={{ bg: hasBalance ? 'gray.600' : 'gray.800', - transform: hasBalance ? 'translateY(0)' : 'none' + transform: hasBalance ? 'translateY(0)' : 'none', }} _disabled={{ opacity: 0.5, @@ -176,8 +176,8 @@ export const StakeUnstakeModal: React.FC = ({ borderColor: 'gray.600', color: 'gray.300', transform: 'none', - boxShadow: 'none' - } + boxShadow: 'none', + }, }} transition="all 0.2s" > @@ -215,14 +215,14 @@ export const StakeUnstakeModal: React.FC = ({ fontSize="sm" fontWeight="500" isDisabled={!isAmountValid()} - _hover={{ + _hover={{ bg: 'teal.600', transform: 'translateY(-1px)', - boxShadow: 'md' + boxShadow: 'md', }} - _active={{ + _active={{ bg: 'teal.700', - transform: 'translateY(0)' + transform: 'translateY(0)', }} _disabled={{ bg: 'gray.700', @@ -231,8 +231,8 @@ export const StakeUnstakeModal: React.FC = ({ _hover: { bg: 'gray.700', transform: 'none', - boxShadow: 'none' - } + boxShadow: 'none', + }, }} transition="all 0.2s" > @@ -252,14 +252,14 @@ export const StakeUnstakeModal: React.FC = ({ fontSize="sm" fontWeight="500" isDisabled={!isAmountValid() || !amount} - _hover={{ + _hover={{ bg: 'teal.600', transform: 'translateY(-1px)', - boxShadow: 'md' + boxShadow: 'md', }} - _active={{ + _active={{ bg: 'teal.700', - transform: 'translateY(0)' + transform: 'translateY(0)', }} _disabled={{ bg: 'gray.700', @@ -268,8 +268,8 @@ export const StakeUnstakeModal: React.FC = ({ _hover: { bg: 'gray.700', transform: 'none', - boxShadow: 'none' - } + boxShadow: 'none', + }, }} transition="all 0.2s" >