Skip to content

Commit

Permalink
symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Apr 19, 2024
1 parent 3073106 commit 8eb9317
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/components/Elements/Balance/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ import { formatBalance } from '@/utils/functions';
interface BalanceProps {
coretimeBalance: Number;
relayBalance: Number;
symbol: string;
}

const Balance = ({ relayBalance, coretimeBalance }: BalanceProps) => {
const Balance = ({ relayBalance, coretimeBalance, symbol }: BalanceProps) => {
const theme = useTheme();

return (
<div style={{ display: 'flex', flexDirection: 'column' }}>
<Typography sx={{ color: theme.palette.text.primary, my: '0.5em' }}>
{`Relay chain: ${formatBalance(relayBalance.toString(), false)} ROC`}
{`Relay chain: ${formatBalance(relayBalance.toString(), false)} ${symbol}`}
</Typography>
<Typography sx={{ color: theme.palette.text.primary, my: '0.5em' }}>
{`Coretime chain: ${formatBalance(coretimeBalance.toString(), false)} ROC`}
{`Coretime chain: ${formatBalance(coretimeBalance.toString(), false)} ${symbol}`}
</Typography>
</div>
);
Expand Down
5 changes: 3 additions & 2 deletions src/components/Elements/Selectors/AssetSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import { Asset } from '@/models';
interface AssetSelectorProps {
asset: Asset;
setAsset: (_: Asset) => void;
symbol: string;
}

export default function AssetSelector({ asset, setAsset }: AssetSelectorProps) {
export default function AssetSelector({ asset, setAsset, symbol }: AssetSelectorProps) {
return (
<FormControl>
<FormLabel>Asset</FormLabel>
Expand All @@ -19,7 +20,7 @@ export default function AssetSelector({ asset, setAsset }: AssetSelectorProps) {
value={asset}
onChange={(e) => setAsset(e.target.value as Asset)}
>
<FormControlLabel value='token' control={<Radio />} label='ROC token' />
<FormControlLabel value='token' control={<Radio />} label={`${symbol} token`} />
<FormControlLabel value='region' control={<Radio />} label='Region' />
</RadioGroup>
</FormControl>
Expand Down
7 changes: 4 additions & 3 deletions src/pages/transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const TransferPage = () => {

const { toastError, toastInfo, toastWarning, toastSuccess } = useToast();
const {
state: { api: coretimeApi, apiState: coretimeApiState },
state: { api: coretimeApi, apiState: coretimeApiState, symbol },
} = useCoretimeApi();
const {
state: { api: relayApi, apiState: relayApiState },
Expand Down Expand Up @@ -259,13 +259,14 @@ const TransferPage = () => {
</Typography>
</Box>
<Balance
symbol={symbol}
coretimeBalance={coretimeBalance}
relayBalance={relayBalance}
/>
</Box>
<Box width='60%' margin='2em auto'>
<Stack margin='1em 0' direction='column' gap={1}>
<AssetSelector asset={asset} setAsset={setAsset} />
<AssetSelector symbol={symbol} asset={asset} setAsset={setAsset} />
</Stack>
<Stack margin='1em 0' direction='column' gap={1}>
<Typography>Origin chain:</Typography>
Expand Down Expand Up @@ -311,7 +312,7 @@ const TransferPage = () => {
<AmountInput
amount={transferAmount}
setAmount={setTransferAmount}
currency='ROC'
currency={symbol}
caption='Transfer amount'
/>
</Stack>
Expand Down

0 comments on commit 8eb9317

Please sign in to comment.