-
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.
Displaying the ended ANT to ETH redemption (#111)
* Ending ANT to ETH redemption * Minor change * Allowing to archive the build * Final touches
- Loading branch information
Showing
3 changed files
with
59 additions
and
133 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: CI | ||
|
||
on: push | ||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Install node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Build ANT Redemption Portal | ||
run: yarn build | ||
- name: Run BundleWatch | ||
run: yarn bundlewatch | ||
- name: Run tests | ||
run: yarn test | ||
- name: Archive build | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ant-portal | ||
path: build/ | ||
retention-days: 1 | ||
|
||
env: | ||
CI: true | ||
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }} |
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,24 @@ 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 tokenTitle = tokenInfo[tokenName].suffix | ||
|
||
|
@@ -91,14 +75,16 @@ function AntV2EthConversionCard({ | |
> | ||
For ANTv2 Holders | ||
</div> | ||
<div | ||
css={` | ||
display: flex; | ||
align-items: center; | ||
`} | ||
> | ||
ETH/ANTv2: {antV2ToEthRate} | ||
</div> | ||
{antV2ToEthRate && ( | ||
<div | ||
css={` | ||
display: flex; | ||
align-items: center; | ||
`} | ||
> | ||
ETH/ANTv2: {antV2ToEthRate} | ||
</div> | ||
)} | ||
</div> | ||
<div | ||
css={` | ||
|
@@ -159,95 +145,23 @@ 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 | ||
css={` | ||
padding-top: ${2 * GU}px; | ||
width: 100%; | ||
height: 100%; | ||
`} | ||
> | ||
<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> | ||
{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 | ||
|
||
<div | ||
css={` | ||
padding-top: ${2 * GU}px; | ||
width: 100%; | ||
height: 100%; | ||
text-align: center; | ||
`} | ||
> | ||
<p> | ||
The ANT Redemption Initiative ended on November 2nd 2024 23:59 | ||
UTC. <br /> | ||
For any questions, please reach out to [email protected] | ||
</p> | ||
)} | ||
</div> | ||
</div> | ||
)} | ||
</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