1 | const breakpoints = {
|
2 | xl: 1200,
|
3 | lg: 992,
|
4 | md: 768,
|
5 | sm: 576,
|
6 | xs: 0
|
7 | };
|
8 | const GlBreakpointInstance = {
|
9 | windowWidth: () => window.innerWidth,
|
10 | getBreakpointSize() {
|
11 | const windowWidth = this.windowWidth();
|
12 | const breakpoint = Object.keys(breakpoints).find(key => windowWidth > breakpoints[key]);
|
13 | return breakpoint;
|
14 | },
|
15 | isDesktop() {
|
16 | return ['xl', 'lg'].includes(this.getBreakpointSize());
|
17 | }
|
18 | };
|
19 |
|
20 | export { GlBreakpointInstance, breakpoints };
|