Browse Source

Fix RecipientAddress stories

master
Loëck Vézien 7 years ago
parent
commit
0ed870f5c9
No known key found for this signature in database GPG Key ID: CBCDCE384E853AC4
  1. 2
      src/components/RecipientAddress/index.js
  2. 35
      src/components/RecipientAddress/stories.js

2
src/components/RecipientAddress/index.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)`

35
src/components/RecipientAddress/stories.js

@ -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}
/>
)}
/>
))

Loading…
Cancel
Save