Files
talk/plugin-api/beta/client/components/SortOption.js
T
Chi Vinh Le e3227322a5 Some docs
2017-08-25 21:22:48 +07:00

32 lines
753 B
JavaScript

import React from 'react';
import styles from './SortOption.css';
import PropTypes from 'prop-types';
export default class SortOption extends React.Component {
render() {
return (
<label className={styles.label}>
<input
type="radio"
onChange={this.props.setSort}
checked={this.props.active}
className={styles.input}
/>
{this.props.label}
</label>
);
}
}
SortOption.propTypes = {
// A simple callback to be called when clicking on this sort option.
setSort: PropTypes.func.isRequired,
// Whether or not this sort option is active.
active: PropTypes.bool.isRequired,
// Label to show next to the input control.
label: PropTypes.string.isRequired,
};