blob: 7e3e9da63bb0c15d57bdcc4a55dc5598ce7f4b95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
export const breakpoints = {
lg: 1200,
md: 992,
sm: 768,
xs: 0,
};
const BreakpointInstance = {
windowWidth: () => window.innerWidth,
getBreakpointSize() {
const windowWidth = this.windowWidth();
const breakpoint = Object.keys(breakpoints).find(key => windowWidth > breakpoints[key]);
return breakpoint;
},
};
// For legacy reasons, this is added to window
// one day this should be deleted
window.bp = BreakpointInstance;
export default BreakpointInstance;
|