spee.ch/react/components/PublishMetadataInputs.jsx

32 lines
823 B
React
Raw Normal View History

2018-01-06 03:26:57 +01:00
import React from 'react';
class MetadataInputs extends React.Component {
constructor (props) {
super(props);
this.state = {
showInputs: false,
};
this.toggleShowInputs = this.toggleShowInputs.bind(this);
}
toggleShowInputs () {
if (this.state.showInputs) {
this.setState({'showInputs': false});
} else {
this.setState({'showInputs': true});
}
}
render () {
return (
<div>
<div className="row row--padded row--no-top row--no-bottom row--wide">
<div className="column column--10">
<a className="label link--primary" id="publish-details-toggle" href="#" onClick={this.toggleShowInputs}>{this.state.showInputs ? '[hide]' : '[show]'}</a>
</div>
</div>
</div>
);
}
}
module.exports = MetadataInputs;