mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Co-authored-by: Brad Decker <bhdecker84@gmail.com> Fixed https://github.com/MetaMask/metamask-extension/issues/16703 Fixes https://github.com/MetaMask/metamask-extension/issues/16703
This commit is contained in:
parent
7f50febfcd
commit
1e173afc95
@ -1,4 +1,4 @@
|
|||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import NumericInput from '.';
|
import NumericInput from '.';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -6,12 +6,11 @@ export default {
|
|||||||
id: __filename,
|
id: __filename,
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChange = (e) => console.log('changed value: ', e.target.value);
|
|
||||||
|
|
||||||
export const DefaultStory = () => {
|
export const DefaultStory = () => {
|
||||||
|
const [value, setValue] = useState(0);
|
||||||
return (
|
return (
|
||||||
<div style={{ width: '600px' }}>
|
<div style={{ width: '600px' }}>
|
||||||
<NumericInput onChange={onChange} />
|
<NumericInput onChange={setValue} value={value} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -19,20 +18,23 @@ export const DefaultStory = () => {
|
|||||||
DefaultStory.storyName = 'Default';
|
DefaultStory.storyName = 'Default';
|
||||||
|
|
||||||
export const WithDetail = () => {
|
export const WithDetail = () => {
|
||||||
|
const [value, setValue] = useState(0);
|
||||||
return (
|
return (
|
||||||
<div style={{ width: '600px' }}>
|
<div style={{ width: '600px' }}>
|
||||||
<NumericInput detailText="= $0.06" onChange={onChange} />
|
<NumericInput detailText="= $0.06" onChange={setValue} value={value} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const WithError = () => {
|
export const WithError = () => {
|
||||||
|
const [value, setValue] = useState(0);
|
||||||
return (
|
return (
|
||||||
<div style={{ width: '600px' }}>
|
<div style={{ width: '600px' }}>
|
||||||
<NumericInput
|
<NumericInput
|
||||||
detailText="= $0.06"
|
detailText="= $0.06"
|
||||||
error="This number isn't great"
|
error="This number isn't great"
|
||||||
onChange={onChange}
|
onChange={setValue}
|
||||||
|
value={value}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user