-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support secp256k1 for numbers (#395)
* Support secp256k1 for numbers * Extract SecretNumberInput from ImportSecretNumbers page * Rename test for ImportSecretNumbers * Fix styling issues * Make use of SecretNumberInput within SecretNumbers page * Extract number count
- Loading branch information
1 parent
25beb8c
commit 7620032
Showing
10 changed files
with
154 additions
and
317 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
packages/extension/src/components/atoms/SecretNumberInput/SecretNumberInput.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,36 @@ | ||
import { Grid, TextField } from '@mui/material'; | ||
import { FC, FocusEvent } from 'react'; | ||
import styles from './styles.module.css'; | ||
import { useNetwork } from '../../../contexts'; | ||
|
||
export interface SecretNumberInputProps { | ||
id: string; | ||
label: string; | ||
error: string; | ||
onBlur: (e: FocusEvent<HTMLInputElement>) => void; | ||
} | ||
|
||
export const SecretNumberInput: FC<SecretNumberInputProps> = ({ id, label, error, onBlur }) => { | ||
const { hasOfflineBanner } = useNetwork(); | ||
|
||
return ( | ||
<Grid item xs={6}> | ||
<TextField | ||
size="small" | ||
id={id} | ||
name={id} | ||
label={label} | ||
error={Boolean(error)} | ||
helperText={error} | ||
style={{ | ||
marginTop: '10px', | ||
marginBottom: error ? '0px' : hasOfflineBanner ? '10px' : '20px', | ||
width: '110px' | ||
}} | ||
className={styles.textField} | ||
autoComplete="off" | ||
onBlur={onBlur} | ||
/> | ||
</Grid> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/extension/src/components/atoms/SecretNumberInput/index.ts
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 @@ | ||
export * from './SecretNumberInput'; |
File renamed without changes.
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
File renamed without changes.
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.