Skip to content

Commit

Permalink
block click claiming
Browse files Browse the repository at this point in the history
  • Loading branch information
namgold committed Jul 28, 2023
1 parent 3700ee3 commit f895b13
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
5 changes: 3 additions & 2 deletions src/components/WalletPopup/RewardCenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import styled from 'styled-components'

import { ReactComponent as DollarIcon } from 'assets/svg/dollar.svg'
import { ButtonPrimary } from 'components/Button'
import Dots from 'components/Dots'

Check failure on line 8 in src/components/WalletPopup/RewardCenter.tsx

View workflow job for this annotation

GitHub Actions / cypress-test

'Dots' is defined but never used

Check warning on line 8 in src/components/WalletPopup/RewardCenter.tsx

View workflow job for this annotation

GitHub Actions / cypress-test

'Dots' is defined but never used
import useMixpanel, { MIXPANEL_TYPE } from 'hooks/useMixpanel'
import { useRewards } from 'hooks/useRewards'
import useTheme from 'hooks/useTheme'
Expand Down Expand Up @@ -141,10 +142,10 @@ export default function RewardCenter() {
padding="4px 15px"
minWidth="unset"
onClick={claimRewards}
disabled={!currentReward.knc || claiming}
disabled={claiming || !currentReward.knc}
>
<Text fontSize={14} fontWeight={500} lineHeight="20px">
<Trans>Claim</Trans>
{claiming ? <Trans>Claiming</Trans> : <Trans>Claim</Trans>}
</Text>
</ButtonPrimary>
</Flex>
Expand Down
24 changes: 9 additions & 15 deletions src/pages/KyberDAO/KNCUtility/GasRefundBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,25 +169,19 @@ export default function GasRefundBox() {
{selectedTab === KNCUtilityTabs.Available ? (
account ? (
isSupportKyberDao(chainId) ? (
claiming ? (
<ButtonPrimary
padding={upToXXSmall ? '8px 28px' : '8px 45px'}
onClick={handleClaimReward}
$disabled
>
<ButtonPrimary
padding={upToXXSmall ? '8px 28px' : '8px 45px'}
onClick={claiming ? undefined : handleClaimReward}
disabled={claiming || (claimableReward?.knc ?? 0) <= 0}
>
{claiming ? (
<Dots>
<Trans>Claiming</Trans>
</Dots>
</ButtonPrimary>
) : (
<ButtonPrimary
padding={upToXXSmall ? '8px 28px' : '8px 45px'}
onClick={handleClaimReward}
disabled={(claimableReward?.knc ?? 0) <= 0}
>
) : (
<Trans>Claim</Trans>
</ButtonPrimary>
)
)}
</ButtonPrimary>
) : (
<MouseoverTooltip
text={
Expand Down

0 comments on commit f895b13

Please sign in to comment.