Skip to content

Commit

Permalink
fix: ui
Browse files Browse the repository at this point in the history
* share dialog style
* token symbol
  • Loading branch information
zhouhanseng committed Jun 18, 2021
1 parent 33a0451 commit 6101980
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 14 deletions.
12 changes: 11 additions & 1 deletion packages/maskbook/src/plugins/ITO/UI/ITO.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import {
useChainId,
useChainIdValid,
useAccount,
useConstant,
CONSTANTS,
isSameAddress,
getChainDetailed,
} from '@dimensiondev/web3-shared'
import { WalletMessages } from '../../Wallet/messages'
import { ITO_Status, JSON_PayloadInMask } from '../types'
Expand Down Expand Up @@ -180,11 +184,17 @@ interface TokenItemProps {

const TokenItem = ({ price, token, exchangeToken }: TokenItemProps) => {
const classes = useStyles({})
const NATIVE_TOKEN_ADDRESS = useConstant(CONSTANTS, 'NATIVE_TOKEN_ADDRESS')

return (
<>
<TokenIcon classes={{ icon: classes.tokenIcon }} address={exchangeToken.address} />
<Typography component="span">
<strong>{price}</strong> {exchangeToken.symbol} / {token.symbol}
<strong>{price}</strong>{' '}
{isSameAddress(exchangeToken.address, NATIVE_TOKEN_ADDRESS)
? getChainDetailed(exchangeToken.chainId)?.nativeCurrency.symbol
: exchangeToken.symbol}{' '}
/ {token.symbol}
</Typography>
</>
)
Expand Down
8 changes: 6 additions & 2 deletions packages/maskbook/src/plugins/ITO/UI/RemindDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const useStyles = makeStyles((theme) => ({
fontWeight: 'bold',
fontSize: '1.1rem',
},
container: {
padding: theme.spacing(2, 0),
},
wrapper: {
padding: theme.spacing(2),
background: theme.palette.mode === 'dark' ? '#17191D' : '#F7F9FA',
Expand All @@ -45,6 +48,7 @@ const useStyles = makeStyles((theme) => ({
display: 'flex',
alignItems: 'center',
marginTop: theme.spacing(2),
padding: theme.spacing(2.5, 0, 3.5, 2),
},
tokenIcon: {
display: 'flex',
Expand Down Expand Up @@ -124,7 +128,7 @@ export function RemindDialog(props: RemindDialogProps) {
const [agreeReminder, setAgreeReminder] = useState(false)

return (
<>
<div className={classes.container}>
<section className={classes.wrapper}>
<Typography variant="body1" className={classNames(classes.reminderText, classes.reminderTextFirst)}>
{t('plugin_ito_dialog_claim_reminder_text1')}
Expand Down Expand Up @@ -179,6 +183,6 @@ export function RemindDialog(props: RemindDialogProps) {
disabled={!agreeReminder}>
{t('plugin_ito_continue')}
</ActionButton>
</>
</div>
)
}
1 change: 0 additions & 1 deletion packages/maskbook/src/plugins/ITO/UI/ShareDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const useStyles = makeStyles((theme) => ({
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
margin: theme.spacing(2, 0),
},
shareAmount: {
fontSize: 36,
Expand Down
7 changes: 5 additions & 2 deletions packages/maskbook/src/plugins/ITO/UI/SwapDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const useStyles = makeStyles((theme) => ({
alignItems: 'center',
marginTop: theme.spacing(2),
},
wrapper: {
padding: theme.spacing(2, 0),
},
swapLimitText: {
color: theme.palette.mode === 'dark' ? '#fff' : '#15181B',
fontSize: 14,
Expand Down Expand Up @@ -250,7 +253,7 @@ export function SwapDialog(props: SwapDialogProps) {
}, [swapAmount, tokenBalance, maxSwapAmount, swapToken, ratio])

return (
<>
<div className={classes.wrapper}>
<section className={classes.swapLimitWrap}>
<Typography variant="body1" className={classes.swapLimitText}>
0 {token.symbol}
Expand Down Expand Up @@ -327,6 +330,6 @@ export function SwapDialog(props: SwapDialogProps) {
</EthereumERC20TokenApprovedBoundary>
</EthereumWalletConnectedBoundary>
</section>
</>
</div>
)
}
21 changes: 13 additions & 8 deletions packages/maskbook/src/plugins/ITO/UI/SwapGuide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const useStyles = makeStyles((theme) => ({
content: {
display: 'flex',
flexDirection: 'column',
padding: theme.spacing(2, 3),
padding: theme.spacing(0, 3),
},
unlockWrapper: {
padding: theme.spacing(2, 0),
},
}))

Expand Down Expand Up @@ -81,13 +84,15 @@ export function SwapGuide(props: SwapGuideProps) {
return <RemindDialog token={payload.token} chainId={chainId} setStatus={onUpdate} />
case SwapStatus.Unlock:
return (
<UnlockDialog
tokens={
payload.exchange_tokens.filter(
(x) => x.type === EthereumTokenType.ERC20,
) as ERC20TokenDetailed[]
}
/>
<div className={classes.unlockWrapper}>
<UnlockDialog
tokens={
payload.exchange_tokens.filter(
(x) => x.type === EthereumTokenType.ERC20,
) as ERC20TokenDetailed[]
}
/>
</div>
)
case SwapStatus.Swap:
return (
Expand Down

0 comments on commit 6101980

Please sign in to comment.