Loëck Vézien
7 years ago
No known key found for this signature in database
GPG Key ID: CBCDCE384E853AC4
2 changed files with
34 additions and
3 deletions
-
src/components/RecipientAddress/index.js
-
src/components/RecipientAddress/stories.js
|
|
@ -18,7 +18,7 @@ const IconQrCode = ({ onClick }: { onClick: Function }) => ( |
|
|
|
const InputAddress = styled(Input).attrs({ |
|
|
|
type: 'text', |
|
|
|
})` |
|
|
|
padding-right: ${p => p.withQrCode && 55}; |
|
|
|
padding-right: ${p => p.withQrCode && '55px'}; |
|
|
|
` |
|
|
|
|
|
|
|
const WrapperQrCode = styled(Box)` |
|
|
|
|
|
@ -1,4 +1,6 @@ |
|
|
|
import React from 'react' |
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React, { PureComponent } from 'react' |
|
|
|
import { storiesOf } from '@storybook/react' |
|
|
|
import { boolean } from '@storybook/addon-knobs' |
|
|
|
|
|
|
@ -6,4 +8,33 @@ import RecipientAddress from 'components/RecipientAddress' |
|
|
|
|
|
|
|
const stories = storiesOf('RecipientAddress', module) |
|
|
|
|
|
|
|
stories.add('basic', () => <RecipientAddress withQrCode={boolean('withQrCode', true)} />) |
|
|
|
type State = { |
|
|
|
value: any, |
|
|
|
} |
|
|
|
|
|
|
|
class Wrapper extends PureComponent<any, State> { |
|
|
|
state = { |
|
|
|
value: '', |
|
|
|
} |
|
|
|
|
|
|
|
handleChange = item => this.setState({ value: item }) |
|
|
|
|
|
|
|
render() { |
|
|
|
const { render } = this.props |
|
|
|
const { value } = this.state |
|
|
|
|
|
|
|
return render({ onChange: this.handleChange, value }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
stories.add('basic', () => ( |
|
|
|
<Wrapper |
|
|
|
render={({ onChange, value }) => ( |
|
|
|
<RecipientAddress |
|
|
|
withQrCode={boolean('withQrCode', true)} |
|
|
|
onChange={onChange} |
|
|
|
value={value} |
|
|
|
/> |
|
|
|
)} |
|
|
|
/> |
|
|
|
)) |
|
|
|