Skip to content

Commit ccfb212

Browse files
committed
Merge branch 'master' of https://github.com/faceless-ui/css-grid
2 parents 4343079 + 0074077 commit ccfb212

File tree

4 files changed

+596
-555
lines changed

4 files changed

+596
-555
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"react-dom": "^17.0.0"
2828
},
2929
"dependencies": {
30-
"@faceless-ui/window-info": "^1.2.7"
30+
"@faceless-ui/window-info": "^2.0.1"
3131
},
3232
"devDependencies": {
3333
"@trbl/eslint-config": "^2.0.3",

src/Cell/index.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ const Cell: React.FC<Props> = (props) => {
3131
let colsToSpan = colsAvailable;
3232

3333
if (cols && cols < colsAvailable) colsToSpan = cols;
34-
if (colsXL && breakpoints.xl) colsToSpan = colsXL;
35-
if (colsL && breakpoints.l) colsToSpan = colsL;
36-
if (colsM && breakpoints.m) colsToSpan = colsM;
37-
if (colsS && breakpoints.s) colsToSpan = colsS;
34+
if (colsXL && breakpoints?.xl) colsToSpan = colsXL;
35+
if (colsL && breakpoints?.l) colsToSpan = colsL;
36+
if (colsM && breakpoints?.m) colsToSpan = colsM;
37+
if (colsS && breakpoints?.s) colsToSpan = colsS;
3838

3939
let colToStart = 0;
4040

4141
if (start) colToStart = start;
42-
if (typeof startXL === 'number' && breakpoints.xl) colToStart = startXL;
43-
if (typeof startL === 'number' && breakpoints.l) colToStart = startL;
44-
if (typeof startM === 'number' && breakpoints.m) colToStart = startM;
45-
if (typeof startS === 'number' && breakpoints.s) colToStart = startS;
42+
if (typeof startXL === 'number' && breakpoints?.xl) colToStart = startXL;
43+
if (typeof startL === 'number' && breakpoints?.l) colToStart = startL;
44+
if (typeof startM === 'number' && breakpoints?.m) colToStart = startM;
45+
if (typeof startS === 'number' && breakpoints?.s) colToStart = startS;
4646

4747
const gridColumnStart = colToStart || undefined;
4848

src/Settings/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const SettingsProvider: React.FC<Props> = (props) => {
2121
const { breakpoints } = useWindowInfo();
2222

2323
let smallestBreakpointReached: 'xl' | 'l' | 'm' | 's' = 'xl';
24-
if (breakpoints.l) smallestBreakpointReached = 'l';
25-
if (breakpoints.m) smallestBreakpointReached = 'm';
26-
if (breakpoints.s) smallestBreakpointReached = 's';
24+
if (breakpoints?.l) smallestBreakpointReached = 'l';
25+
if (breakpoints?.m) smallestBreakpointReached = 'm';
26+
if (breakpoints?.s) smallestBreakpointReached = 's';
2727

2828
const maxColumns = cols[smallestBreakpointReached];
2929
const activeColumnGap = colGap[smallestBreakpointReached];

0 commit comments

Comments
 (0)