Fix input element styling madness
This commit is contained in:
@@ -1,42 +1,33 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { Text, Button, Icon } from 'ui'
|
||||
import { Text, Icon } from 'ui'
|
||||
|
||||
export default class BoundEmailIcon extends React.Component {
|
||||
static propTypes = {
|
||||
name: PropTypes.string,
|
||||
binder: PropTypes.object,
|
||||
width: PropTypes.number,
|
||||
onClick: PropTypes.func
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = props.binder.getField('emailValidated')
|
||||
this.state = props.binder.getFieldState(props.name)
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.binder !== this.props.binder) {
|
||||
this.setState(nextProps.binder.getField(nextProps.name))
|
||||
this.setState(nextProps.binder.getFieldState(nextProps.name))
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.value) {
|
||||
return (
|
||||
<div width={this.props.width}>
|
||||
<Text> </Text>
|
||||
<Icon name='mail' color='green' size='big' />
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<div width={this.props.width}>
|
||||
<Text> </Text>
|
||||
<Button icon='mail outline' color='red' labelPosition='left'
|
||||
content='Resend Email' onClick={this.props.onClick} disabled={this.state.disabled} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
// const { value } = this.state
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Text> </Text>
|
||||
<br />
|
||||
<Icon name='mail' size={30} margin={0} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user