Web: Common: Refactoring HOC withLayoutSize
This commit is contained in:
parent
c6d4b5bf60
commit
3702bd597d
@ -290,15 +290,14 @@ class SectionFilterContent extends React.Component {
|
||||
this.state.isReady !== nextState.isReady ||
|
||||
this.props.viewAs !== nextProps.viewAs ||
|
||||
this.props.firstLoad !== nextProps.firstLoad ||
|
||||
!isEqual(this.props.context, nextProps.context)
|
||||
this.props.sectionWidth !== nextProps.sectionWidth
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log("Filter render");
|
||||
const selectedFilterData = this.getSelectedFilterData();
|
||||
const { t, language, firstLoad, context } = this.props;
|
||||
const { sectionWidth } = context;
|
||||
const { t, language, firstLoad, sectionWidth } = this.props;
|
||||
const filterColumnCount =
|
||||
window.innerWidth < 500 ? {} : { filterColumnCount: 3 };
|
||||
return firstLoad ? (
|
||||
|
@ -250,8 +250,7 @@ class SectionFilterContent extends React.Component {
|
||||
|
||||
render() {
|
||||
const selectedFilterData = this.getSelectedFilterData();
|
||||
const { t, language, isLoaded, context } = this.props;
|
||||
const { sectionWidth } = context;
|
||||
const { t, language, isLoaded, sectionWidth } = this.props;
|
||||
return isLoaded ? (
|
||||
<FilterInput
|
||||
sectionWidth={sectionWidth}
|
||||
|
@ -7,7 +7,7 @@ export function withLayoutSize(Component) {
|
||||
return (
|
||||
<Consumer>
|
||||
{(context) => {
|
||||
return <Component {...props} context={context} />;
|
||||
return <Component {...props} {...context} />;
|
||||
}}
|
||||
</Consumer>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user