You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrap child component with [Redux](https://github.com/rackt/redux)`Provider`and exposes the props `options` (array) to define custom grid settings.
51
+
Wrap child component with [React Redux](https://github.com/rackt/react-redux#provider-store)`<Provider>`, update store according to device properties update using [media queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries)and exposes the props `options` (array) allowing you to define custom grid settings.
52
52
53
53
`options` shape:
54
54
55
55
```js
56
56
[
57
57
{
58
58
name: string // required - Name of the target screen, used as key word ex: <name>-12.
59
-
order: number // required - From smaller to bigger screen.
60
-
query: string // required - Media query to test.
61
59
gutter: number // default = 0 - Gutter size in pixel.
62
60
margin: number // default = 0 - Margin size in pixel.
63
61
columns: number // default = 12 - Total number of columns for each row.
62
+
query: string // required - Media query to test.
64
63
}
65
64
]
66
65
```
@@ -74,28 +73,28 @@ If `options` is not provided, a default configuration inspired by [Google MDL](h
74
73
gutter:16,
75
74
margin:16,
76
75
columns:4,
77
-
order:0,
78
76
query:'(max-width: 479px)'
79
77
},
80
78
{
81
79
name:'tablet',
82
80
gutter:16,
83
81
margin:16,
84
82
columns:8,
85
-
order:1,
86
83
query:'(min-width: 480px) and (max-width: 839px)'
87
84
},
88
85
{
89
86
name:'desktop',
90
87
gutter:16,
91
88
margin:16,
92
89
columns:12,
93
-
order:2,
94
90
query:'(min-width: 840px)'
95
91
}
96
92
]
97
93
```
98
94
95
+
Also, as the style properties are generated from `options` using the ["bigger" device as reference](https://github.com/broucz/react-inline-grid/blob/master/src/utils/hydrateReference.js#L12), target devices order in `options` matters.
96
+
I want to avoid to test queries at loading time or add extra fields in `options` so far, and so I choose the "popular" mobile first approch. **The "bigger" targeted device have to be the last entry of `options`**.
97
+
99
98
### <Row />
100
99
101
100
Exposes the props `is` (string) to alterate the following default style object:
@@ -146,9 +145,6 @@ Exposes the props `is` (string) to alterate the following default style object:
0 commit comments