replaced eslint:recommended with prettier

This commit is contained in:
Wyatt Johnson
2018-01-11 20:00:34 -07:00
parent d56c19016a
commit 0abc2ca243
649 changed files with 16235 additions and 13008 deletions
+31 -26
View File
@@ -1,17 +1,20 @@
import React from 'react';
import {connect} from 'plugin-api/beta/client/hocs';
import {bindActionCreators} from 'redux';
import {sortOrderSelector, sortBySelector} from 'plugin-api/beta/client/selectors/stream';
import {setSort} from 'plugin-api/beta/client/actions/stream';
import { connect } from 'plugin-api/beta/client/hocs';
import { bindActionCreators } from 'redux';
import {
sortOrderSelector,
sortBySelector,
} from 'plugin-api/beta/client/selectors/stream';
import { setSort } from 'plugin-api/beta/client/actions/stream';
import hoistStatics from 'recompose/hoistStatics';
import {closeMenu} from 'plugins/talk-plugin-viewing-options/client/actions';
import { closeMenu } from 'plugins/talk-plugin-viewing-options/client/actions';
const mapStateToProps = (state) => ({
const mapStateToProps = state => ({
sortOrder: sortOrderSelector(state),
sortBy: sortBySelector(state),
});
const mapDispatchToProps = (dispatch) =>
const mapDispatchToProps = dispatch =>
bindActionCreators(
{
setSort,
@@ -28,24 +31,26 @@ const mapDispatchToProps = (dispatch) =>
* @param {string} sort.sortOrder
* @return {Object} HOC
*/
export default ({sortBy = 'created_at', sortOrder = 'DESC', label}) => hoistStatics((WrappedComponent) => {
class WithSortOption extends React.Component {
setSort = () => {
this.props.closeMenu();
this.props.setSort({sortBy, sortOrder});
}
export default ({ sortBy = 'created_at', sortOrder = 'DESC', label }) =>
hoistStatics(WrappedComponent => {
class WithSortOption extends React.Component {
setSort = () => {
this.props.closeMenu();
this.props.setSort({ sortBy, sortOrder });
};
render() {
const active = this.props.sortOrder === sortOrder && this.props.sortBy === sortBy;
const resolvedLabel = typeof label === 'function' ? label() : label;
return (
<WrappedComponent
active={active}
setSort={this.setSort}
label={resolvedLabel}
/>
);
render() {
const active =
this.props.sortOrder === sortOrder && this.props.sortBy === sortBy;
const resolvedLabel = typeof label === 'function' ? label() : label;
return (
<WrappedComponent
active={active}
setSort={this.setSort}
label={resolvedLabel}
/>
);
}
}
}
return connect(mapStateToProps, mapDispatchToProps)(WithSortOption);
});
return connect(mapStateToProps, mapDispatchToProps)(WithSortOption);
});