2017-04-11 17:35:40 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* LimitSelect
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
2017-09-18 09:34:29 +02:00
|
|
|
// import PropTypes from 'prop-types';
|
2017-04-11 18:30:57 +02:00
|
|
|
import _ from 'lodash';
|
2017-06-28 22:01:42 +02:00
|
|
|
|
2017-05-11 10:54:44 +02:00
|
|
|
class LimitSelect extends React.Component {
|
2017-04-11 18:30:57 +02:00
|
|
|
componentWillMount() {
|
|
|
|
const id = _.uniqueId();
|
|
|
|
this.setState({ id });
|
|
|
|
}
|
|
|
|
|
2017-05-11 10:54:44 +02:00
|
|
|
shouldComponentUpdate() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-04-11 18:37:09 +02:00
|
|
|
/**
|
|
|
|
* Return the list of default values to populate the select options
|
|
|
|
*
|
|
|
|
* @returns {number[]}
|
|
|
|
*/
|
2017-04-11 17:35:40 +02:00
|
|
|
getOptionsValues() {
|
2017-04-11 18:37:09 +02:00
|
|
|
return [10, 20, 50, 100];
|
2017-04-11 17:35:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2017-08-30 17:56:52 +02:00
|
|
|
return <div />;
|
2017-04-11 18:30:57 +02:00
|
|
|
|
2017-08-30 17:56:52 +02:00
|
|
|
// // Generate options
|
|
|
|
// const options = this.getOptionsValues().map(optionValue => (
|
|
|
|
// <option value={optionValue} key={optionValue}>{optionValue}</option>
|
|
|
|
// ));
|
|
|
|
//
|
|
|
|
// // Get id in order to link the `label` and the `select` elements
|
|
|
|
// const id = this.state.id;
|
|
|
|
//
|
|
|
|
// return (
|
|
|
|
// <form className="form-inline">
|
|
|
|
// <div className="form-group">
|
|
|
|
// <label className={styles.label} htmlFor={id}>
|
|
|
|
// <FormattedMessage id="content-manager.components.LimitSelect.itemsPerPage" />:
|
|
|
|
// </label>
|
|
|
|
// <div className={styles.selectWrapper}>
|
|
|
|
// <select
|
|
|
|
// onChange={this.props.onLimitChange}
|
|
|
|
// className={`form-control ${styles.select}`}
|
|
|
|
// id={id}
|
|
|
|
// >
|
|
|
|
// {options}
|
|
|
|
// </select>
|
|
|
|
// </div>
|
|
|
|
// </div>
|
|
|
|
// </form>
|
|
|
|
// );
|
2017-04-11 17:35:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-11 19:20:33 +02:00
|
|
|
LimitSelect.propTypes = {
|
2017-09-18 09:34:29 +02:00
|
|
|
// onLimitChange: PropTypes.func.isRequired,
|
2017-04-11 19:20:33 +02:00
|
|
|
};
|
|
|
|
|
2017-04-11 17:35:40 +02:00
|
|
|
export default LimitSelect;
|