mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
* Organizing storybook to echo app folder structure * Updating new stories to follow new convention from develop
40 lines
785 B
JavaScript
40 lines
785 B
JavaScript
import React from 'react';
|
|
import NumericInput from '.';
|
|
|
|
export default {
|
|
title: 'Components/UI/NumericInput',
|
|
id: __filename,
|
|
};
|
|
|
|
const onChange = (e) => console.log('changed value: ', e.target.value);
|
|
|
|
export const DefaultStory = () => {
|
|
return (
|
|
<div style={{ width: '600px' }}>
|
|
<NumericInput onChange={onChange} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
DefaultStory.storyName = 'Default';
|
|
|
|
export const WithDetail = () => {
|
|
return (
|
|
<div style={{ width: '600px' }}>
|
|
<NumericInput detailText="= $0.06" onChange={onChange} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export const WithError = () => {
|
|
return (
|
|
<div style={{ width: '600px' }}>
|
|
<NumericInput
|
|
detailText="= $0.06"
|
|
error="This number isn't great"
|
|
onChange={onChange}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|