Skip to content

Commit

Permalink
use uncontrolled component for amount input (#203)
Browse files Browse the repository at this point in the history
* use uncontrolled component for amount input

* fix build error
  • Loading branch information
cuteolaf authored Aug 1, 2024
1 parent 115b53b commit f9e25bd
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/components/Elements/Inputs/AmountInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { InputAdornment, Stack, TextField, Typography } from '@mui/material';

interface AmountInputProps {
amount?: number;
currency: string;
title?: string;
caption?: string;
Expand All @@ -11,7 +10,6 @@ interface AmountInputProps {
// TODO: Fetch dot price and show how much is the currency amount worth.

export const AmountInput = ({
amount,
currency,
title,
caption,
Expand All @@ -28,7 +26,6 @@ export const AmountInput = ({
{caption && <Typography lineHeight={1}>{caption}</Typography>}
</Stack>
<TextField
value={amount || '0'}
placeholder={`Enter ${currency} amount`}
InputProps={{
endAdornment: (
Expand Down
1 change: 0 additions & 1 deletion src/components/Modals/Orders/Contribution/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export const ContributionModal = ({
<OrderCard order={order} direction='horizontal' />
<Stack direction='column' gap='1rem'>
<AmountInput
amount={amount}
currency={relaySymbol}
caption='Contribution amount'
setAmount={(value: number) => setAmount(value)}
Expand Down
1 change: 0 additions & 1 deletion src/components/Modals/Regions/Sell/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ export const SellModal = ({
<Paper className={styles.wrapper}>
<Stack direction='column' gap={2}>
<AmountInput
amount={price}
caption='Total price of the region'
currency={coretimeSymbol}
setAmount={setPrice}
Expand Down
1 change: 0 additions & 1 deletion src/pages/transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ const TransferPage = () => {
destinationChain !== ChainType.NONE && (
<Stack margin='2em 0' direction='column' gap={1}>
<AmountInput
amount={transferAmount}
setAmount={setTransferAmount}
currency={symbol}
caption='Transfer amount'
Expand Down

0 comments on commit f9e25bd

Please sign in to comment.