mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-13 09:11:19 -05:00
21 lines
592 B
React
21 lines
592 B
React
|
var React = require('react');
|
||
|
|
||
|
module.exports = function InputComponentMixin (Component) {
|
||
|
var InputComponent = React.createClass({
|
||
|
getDefaultProps: function () {
|
||
|
return {
|
||
|
messages: {
|
||
|
'general.notRequired': 'Not Required'
|
||
|
}
|
||
|
};
|
||
|
},
|
||
|
render: function () {
|
||
|
return (
|
||
|
<Component help={this.props.required ? null : this.props.messages['general.notRequired']}
|
||
|
{...this.props} />
|
||
|
);
|
||
|
}
|
||
|
});
|
||
|
return InputComponent;
|
||
|
};
|