-
Notifications
You must be signed in to change notification settings - Fork 375
Expand file tree
/
Copy pathLayoutContainer.js
More file actions
36 lines (33 loc) · 1.06 KB
/
LayoutContainer.js
File metadata and controls
36 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from '../utils/griddleConnect';
import getContext from 'recompose/getContext';
import mapProps from 'recompose/mapProps';
import compose from 'recompose/compose';
//import { classNamesForComponentSelector, stylesForComponentSelector } from '../selectors/dataSelectors';
const EnhancedLayout = OriginalComponent => compose(
getContext({
components: PropTypes.object,
selectors: PropTypes.object
}),
connect(
(state, props) => ({
className: props.selectors.classNamesForComponentSelector(state, 'Layout'),
style: props.selectors.stylesForComponentSelector(state, 'Layout'),
})
),
mapProps( props => ({
Table: props.components.Table,
Pagination: props.components.Pagination,
Filter: props.components.Filter,
SettingsWrapper: props.components.SettingsWrapper,
Style: props.components.Style,
className: props.className,
style: props.style,
})),
)(props => (
<OriginalComponent
{...props}
/>
));
export default EnhancedLayout;