Skip to content

Commit

Permalink
Adjust config
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskoster committed Jul 18, 2024
1 parent 0a478de commit 3c75796
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/dataviews/src/layouts/grid/density-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ import { plus, lineSolid } from '@wordpress/icons';
import { useEffect } from '@wordpress/element';

const viewPortBreaks = {
xhuge: { min: 2, max: 6, default: 4 },
huge: { min: 2, max: 5, default: 4 },
xhuge: { min: 3, max: 5, default: 5 },
huge: { min: 2, max: 4, default: 4 },
xlarge: { min: 2, max: 3, default: 3 },
mobile: { min: 2, max: 3, default: 2 },
large: { min: 1, max: 2, default: 2 },
mobile: { min: 1, max: 2, default: 2 },
};

function useViewPortBreakpoint() {
const isXHuge = useViewportMatch( 'xhuge', '>=' );
const isHuge = useViewportMatch( 'huge', '>=' );
const isXlarge = useViewportMatch( 'xlarge', '>=' );
const isLarge = useViewportMatch( 'large', '>=' );
const isMobile = useViewportMatch( 'mobile', '>=' );

if ( isXHuge ) {
Expand All @@ -29,6 +31,9 @@ function useViewPortBreakpoint() {
if ( isXlarge ) {
return 'xlarge';
}
if ( isLarge ) {
return 'large';
}
if ( isMobile ) {
return 'mobile';
}
Expand Down

0 comments on commit 3c75796

Please sign in to comment.