2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-06-01 13:02:53 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
2015-07-10 15:56:54 +02:00
|
|
|
import { getLangText } from '../../utils/lang_utils';
|
2015-06-01 13:02:53 +02:00
|
|
|
|
|
|
|
let InputCheckbox = React.createClass({
|
2015-06-09 16:10:38 +02:00
|
|
|
propTypes: {
|
|
|
|
required: React.PropTypes.string.isRequired,
|
|
|
|
label: React.PropTypes.string.isRequired
|
|
|
|
},
|
2015-06-01 13:02:53 +02:00
|
|
|
|
|
|
|
getInitialState() {
|
2015-06-05 11:06:36 +02:00
|
|
|
return {
|
2015-07-10 15:56:54 +02:00
|
|
|
show: false
|
2015-06-01 13:02:53 +02:00
|
|
|
};
|
|
|
|
},
|
2015-07-10 15:56:54 +02:00
|
|
|
|
|
|
|
handleFocus() {
|
|
|
|
this.refs.checkbox.getDOMNode().checked = !this.refs.checkbox.getDOMNode().checked;
|
|
|
|
this.setState({
|
2015-07-10 18:51:35 +02:00
|
|
|
show: this.refs.checkbox.getDOMNode().checked,
|
|
|
|
value: this.refs.checkbox.getDOMNode().checked
|
2015-07-10 15:56:54 +02:00
|
|
|
});
|
2015-06-01 13:02:53 +02:00
|
|
|
},
|
2015-06-05 11:06:36 +02:00
|
|
|
|
2015-06-01 13:02:53 +02:00
|
|
|
render() {
|
|
|
|
return (
|
2015-07-10 15:56:54 +02:00
|
|
|
<span
|
|
|
|
onClick={this.handleFocus}
|
|
|
|
onFocus={this.handleFocus}>
|
|
|
|
<input type="checkbox" ref="checkbox"/>
|
|
|
|
<span className="checkbox">
|
|
|
|
<span>
|
2015-07-10 16:04:57 +02:00
|
|
|
{' ' + getLangText('I agree to the Terms of Service') + ' '}
|
2015-07-10 15:56:54 +02:00
|
|
|
(<a href="/terms" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
|
|
|
|
{getLangText('read')}
|
|
|
|
</a>)
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
2015-06-01 13:02:53 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default InputCheckbox;
|