1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

made inputcheckbox component generic

This commit is contained in:
Tim Daubenschütz 2015-07-14 19:53:49 +02:00
parent 49b530870d
commit aa5934cd25
2 changed files with 13 additions and 8 deletions

View File

@ -126,7 +126,14 @@ let SignupForm = React.createClass({
name="terms" name="terms"
className="ascribe-settings-property-collapsible-toggle" className="ascribe-settings-property-collapsible-toggle"
style={{paddingBottom: 0}}> style={{paddingBottom: 0}}>
<InputCheckbox/> <InputCheckbox>
<span>
{' ' + getLangText('I agree to the Terms of Service') + ' '}
(<a href="/terms" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
{getLangText('read')}
</a>)
</span>
</InputCheckbox>
</Property> </Property>
</Form> </Form>
); );

View File

@ -7,7 +7,10 @@ import { getLangText } from '../../utils/lang_utils';
let InputCheckbox = React.createClass({ let InputCheckbox = React.createClass({
propTypes: { propTypes: {
required: React.PropTypes.string.isRequired, required: React.PropTypes.string.isRequired,
label: React.PropTypes.string.isRequired children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element
]).isRequired
}, },
getInitialState() { getInitialState() {
@ -31,12 +34,7 @@ let InputCheckbox = React.createClass({
onFocus={this.handleFocus}> onFocus={this.handleFocus}>
<input type="checkbox" ref="checkbox"/> <input type="checkbox" ref="checkbox"/>
<span className="checkbox"> <span className="checkbox">
<span> {this.props.children}
{' ' + getLangText('I agree to the Terms of Service') + ' '}
(<a href="/terms" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
{getLangText('read')}
</a>)
</span>
</span> </span>
</span> </span>
); );