-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from CudoVentures/cudos-dev
Release 1.1.0.5
- Loading branch information
Showing
20 changed files
with
247 additions
and
227 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
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
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
65 changes: 65 additions & 0 deletions
65
src/components/Dialog/components/DelegationModal/helpers.tsx
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,65 @@ | ||
import { Tooltip, Button } from '@mui/material' | ||
import CurrencyInput from 'react-currency-input-field' | ||
import CudosLogo from 'assets/vectors/cudos-logo.svg' | ||
import { customInputStyle } from "../styles" | ||
|
||
export const CustomEndAdorment = ({ | ||
handleClick | ||
}: { | ||
handleClick: () => Promise<void> | ||
}) => { | ||
return ( | ||
<Tooltip title="Total balance minus the highest estimated fee (estimated transaction fee x4)"> | ||
<Button | ||
variant="contained" | ||
color="primary" | ||
size="small" | ||
sx={() => ({ | ||
padding: '4px 15px', | ||
fontWeight: 600 | ||
})} | ||
onClick={handleClick} | ||
> | ||
MAX | ||
</Button> | ||
</Tooltip> | ||
) | ||
} | ||
|
||
export const customInputProps = ( | ||
delegationAmount: string, | ||
setDelegationAmount: React.Dispatch<React.SetStateAction<string>>, | ||
handleMaxAmount: () => Promise<void> | ||
) => { | ||
|
||
return { | ||
inputComponent: | ||
() => <CustomInputComponent | ||
displayValue={delegationAmount} | ||
setValue={setDelegationAmount} | ||
/>, | ||
disableUnderline: true, | ||
startAdornment: <img src={CudosLogo} alt="cudos-logo" />, | ||
endAdornment: <CustomEndAdorment handleClick={handleMaxAmount} /> | ||
} | ||
} | ||
|
||
export const CustomInputComponent = ({ | ||
displayValue, | ||
setValue | ||
}: { | ||
displayValue: string, | ||
setValue: React.Dispatch<React.SetStateAction<string>> | ||
}) => { | ||
|
||
return ( | ||
<CurrencyInput | ||
autoFocus={true} | ||
style={customInputStyle} | ||
placeholder="0 CUDOS" | ||
decimalsLimit={18} | ||
value={displayValue} | ||
onValueChange={(value) => setValue(value!)} | ||
/> | ||
) | ||
} |
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
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
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
Oops, something went wrong.