smarti/src/helpers/handleBreakpoints.js
2023-01-02 12:21:18 +01:00

16 lines
448 B
JavaScript

export const isWidthDown = (breakpoint, screenWidth) => {
switch (breakpoint) {
case "xs":
return screenWidth < 600;
case "sm":
return screenWidth < 900;
case "md":
return screenWidth < 1200;
case "lg":
return screenWidth < 1536;
case "xl":
return screenWidth >= 1920;
default:
throw new Error("Invalid breakpoint");
}
}