Small tweaks to hash input (#9)
This commit is contained in:
parent
f60f4ede89
commit
a514337b9b
@ -14,7 +14,13 @@ import Base from './Base';
|
||||
export default function Hash ({ isError, label, subject, t }: Props): React$Node {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const onChange = (event: SyntheticEvent<*>, { value }) => {
|
||||
const u8a = hexToU8a(value);
|
||||
let u8a;
|
||||
|
||||
try {
|
||||
u8a = hexToU8a(value);
|
||||
} catch (error) {
|
||||
u8a = new Uint8Array([]);
|
||||
}
|
||||
|
||||
subject.next({
|
||||
isValid: u8a.length === 32,
|
||||
@ -25,11 +31,12 @@ export default function Hash ({ isError, label, subject, t }: Props): React$Node
|
||||
return (
|
||||
<Base
|
||||
label={label}
|
||||
size='small'
|
||||
size='medium'
|
||||
>
|
||||
<Input
|
||||
error={isError}
|
||||
onChange={onChange}
|
||||
placeholder='0x...'
|
||||
type='text'
|
||||
/>
|
||||
</Base>
|
||||
|
||||
@ -30,7 +30,7 @@ export default function VoteThreshold ({ label, subject, t, value: { options: {
|
||||
>
|
||||
<Dropdown
|
||||
selection
|
||||
defaultValue={initValue}
|
||||
defaultValue={initValue || 0}
|
||||
options={options}
|
||||
onChange={onChange}
|
||||
/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user