mirror of
https://github.com/wassname/talk.git
synced 2026-07-18 12:40:13 +08:00
Merge branch 'master' into slots-debug
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
.label {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
padding: 6px 16px 6px 10px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
}
|
||||
|
||||
.input {
|
||||
cursor: pointer;
|
||||
margin-right: 6px;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
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,
|
||||
};
|
||||
@@ -1,13 +0,0 @@
|
||||
import withSortOption from '../hocs/withSortOption';
|
||||
import SortOption from '../components/SortOption';
|
||||
|
||||
/**
|
||||
* A factory creating a sort option component.
|
||||
* @param {string|function} label label to display, can be a callback for lazy evaluation.
|
||||
* @param {Object} sort sort parameters
|
||||
* @param {string} sort.sortBy
|
||||
* @param {string} sort.sortOrder
|
||||
* @return {Object} Component
|
||||
*/
|
||||
export const createSortOption = (label, sort) =>
|
||||
withSortOption({ ...sort, label })(SortOption);
|
||||
Reference in New Issue
Block a user