-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,40 +5,27 @@ import { | |
useLayout, | ||
// @ts-ignore | ||
} from '@aragon/ui' | ||
import { useHistory } from 'react-router-dom' | ||
import TokenGraphic from '../TokenGraphic/TokenGraphic' | ||
import BrandButton from '../BrandButton/BrandButton' | ||
import { BalanceItem } from './BalanceCard' | ||
import { radius } from '../../style/radius' | ||
import { fontWeight } from '../../style/font' | ||
import { TokenName } from '../../token-info/types' | ||
import { tokenInfo } from '../../token-info/tokenInfo' | ||
import rightArrowPng from '../../assets/right-arrow.png' | ||
import LockIcon from '../icons/LockIcon' | ||
import { REDEEM_ANTV2_PATH } from '../../Routes' | ||
import useAntV2ToEthRate from '../../hooks/useAntV2ToEthRate' | ||
import { theme as localTheme } from '../../style/theme' | ||
|
||
type AntV2EthConversionCardProps = { | ||
balance: string | null | ||
accountConnected: boolean | ||
available?: boolean | ||
} | ||
|
||
function AntV2EthConversionCard({ | ||
balance: antBalance, | ||
accountConnected, | ||
available = true, | ||
}: AntV2EthConversionCardProps): JSX.Element { | ||
function AntV2EthConversionCard(): JSX.Element { | ||
const available = false | ||
const tokenName: TokenName = 'antV2' | ||
|
||
const theme = useTheme() | ||
const history = useHistory() | ||
const { layoutName } = useLayout() | ||
const antV2ToEthRate = useAntV2ToEthRate() | ||
|
||
const compactMode = layoutName === 'small' | ||
const tabletMobileMode = layoutName === 'small' || layoutName === 'medium' | ||
// const tabletMobileMode = layoutName === 'small' || layoutName === 'medium' | ||
|
||
const tokenTitle = tokenInfo[tokenName].suffix | ||
|
||
|
@@ -159,95 +146,29 @@ function AntV2EthConversionCard({ | |
{tokenTitle} to ETH | ||
</h3> | ||
</div> | ||
{available ? ( | ||
<div | ||
css={` | ||
padding-top: ${2 * GU}px; | ||
`} | ||
> | ||
<BrandButton | ||
mode="strong" | ||
size="large" | ||
wide | ||
disabled={!antBalance || antBalance === '0'} | ||
onClick={() => { | ||
history.push(REDEEM_ANTV2_PATH) | ||
}} | ||
label="Start now" | ||
/> | ||
</div> | ||
) : ( | ||
<div | ||
|
||
<div | ||
css={` | ||
padding-top: ${2 * GU}px; | ||
width: 100%; | ||
height: 100%; | ||
`} | ||
> | ||
<BrandButton | ||
icon={<LockIcon />} | ||
mode="strong" | ||
size="large" | ||
wide | ||
disabled={true} | ||
label="The ANT Redemption Initiative ended on November 2nd 2024 23:59 UTC. For any questions, please reach out to [email protected]" | ||
css={` | ||
padding-top: ${2 * GU}px; | ||
width: 100%; | ||
height: 100%; | ||
height: ${14.75 * GU}px; | ||
`} | ||
> | ||
<BrandButton | ||
icon={<LockIcon />} | ||
mode="strong" | ||
size="large" | ||
wide | ||
disabled={true} | ||
label="Please, ensure that you are connected to Ethereum mainnet" | ||
css={` | ||
width: 100%; | ||
height: ${14.75 * GU}px; | ||
`} | ||
/> | ||
</div> | ||
)} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
{available && ( | ||
<div | ||
css={` | ||
font-size: 18px; | ||
line-height: 1; | ||
`} | ||
> | ||
{accountConnected ? ( | ||
<ul | ||
css={` | ||
${!tabletMobileMode && | ||
`& > * { | ||
max-width: 400px; | ||
margin-left: auto; | ||
margin-bottom: ${1.5 * GU}px; | ||
}`} | ||
`} | ||
> | ||
<BalanceItem | ||
title={ | ||
<span> | ||
Redeemable{' '} | ||
<span | ||
css={` | ||
font-weight: bold; | ||
`} | ||
> | ||
{tokenTitle} | ||
</span>{' '} | ||
balance | ||
</span> | ||
} | ||
amount={antBalance} | ||
compactMode={compactMode} | ||
tokenName={tokenName} | ||
/> | ||
</ul> | ||
) : ( | ||
<p | ||
css={` | ||
color: ${localTheme.secondary}; | ||
`} | ||
> | ||
Enable account to see your balance | ||
</p> | ||
)} | ||
</div> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters