ghost-dao-interface/src/containers/Bridge/BridgeSettingsModal.jsx
Uncle Fatso 5b8e34e8d0
tooltips updated
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
2026-11-23 15:09:09 +03:00

128 lines
5.1 KiB
JavaScript

import { useState, useEffect } from "react";
import { Box, Typography, FormControl, OutlinedInput, InputLabel } from "@mui/material";
import { BridgeGhostAddressCard } from "./BridgeGhostAddress";
import Modal from "../../components/Modal/Modal";
export const BridgeInSettingsModal = ({ isOpen, onClose, decimals, setDecimals, receiver, setReceiver }) => {
return (
<Modal
data-testid="bridge-in-settings-modal"
maxWidth="476px"
headerContent={<Typography variant="h6">Bridge-In Settings</Typography>}
open={isOpen}
onClose={onClose}
minHeight={"100px"}
>
<Box>
<InputLabel htmlFor="recipient">Decimal representation</InputLabel>
<Box mt="8px">
<FormControl variant="outlined" color="primary" fullWidth>
<OutlinedInput
inputProps={{ "data-testid": "decimals-to-wait" }}
type="number"
id="decimals-to-wait"
value={decimals}
onChange={event => setDecimals(event.currentTarget.value)}
endAdornment="decimals"
/>
</FormControl>
</Box>
<Box mt="8px">
<Typography variant="body2" color="textSecondary">
Number of decimals to be shown in token balances
</Typography>
</Box>
</Box>
<Box mt="32px">
<InputLabel htmlFor="recipient">Destination address</InputLabel>
<Box mt="8px">
<BridgeGhostAddressCard receiver={receiver} setReceiver={setReceiver} />
<Typography mt="8px" variant="body2" color="textSecondary">
Custom recipient address of bridged assets
</Typography>
</Box>
</Box>
</Modal>
)
}
export const BridgeOutSettingsModal = ({
isOpen,
onClose,
decimals,
setDecimals,
receiver,
setReceiver,
allocation,
setAllocation,
nativeSymbol
}) => {
return (
<Modal
data-testid="bridge-in-settings-modal"
maxWidth="476px"
headerContent={<Typography variant="h6">Bridge-Out Settings</Typography>}
open={isOpen}
onClose={onClose}
minHeight={"100px"}
>
<Box display="flex" flexDirection="column" gap="15px">
<Box mt="8px">
<InputLabel htmlFor="allocation">{nativeSymbol} allocation</InputLabel>
<Box mt="8px">
<FormControl variant="outlined" color="primary" fullWidth>
<OutlinedInput
inputProps={{ "data-testid": "allocation-to-native" }}
type="number"
id="allocation-to-native"
value={allocation}
onChange={event => setAllocation(event.currentTarget.value)}
endAdornment="%"
/>
</FormControl>
</Box>
<Box mt="8px">
<Typography variant="body2" color="textSecondary">
Bridge-Out share converted to {nativeSymbol}
</Typography>
</Box>
</Box>
<Box mt="8px">
<InputLabel htmlFor="decimals">Decimal representation</InputLabel>
<Box mt="8px">
<FormControl variant="outlined" color="primary" fullWidth>
<OutlinedInput
inputProps={{ "data-testid": "decimals-to-wait" }}
type="number"
id="decimals-to-wait"
value={decimals}
onChange={event => setDecimals(event.currentTarget.value)}
endAdornment="decimals"
/>
</FormControl>
</Box>
<Box mt="8px">
<Typography variant="body2" color="textSecondary">
Number of decimals to be shown in token balances
</Typography>
</Box>
</Box>
<Box mt="8px">
<InputLabel htmlFor="recipient">Custom destination address</InputLabel>
<Box mt="8px">
<BridgeGhostAddressCard isEvm receiver={receiver} setReceiver={setReceiver} />
<Typography mt="8px" variant="body2" color="textSecondary">
Recipient address of bridged-out assets
</Typography>
</Box>
</Box>
</Box>
</Modal>
)
}