Skip to content

Commit 782d251

Browse files
committed
refactor(components): update variables to use common breakpoint values
1 parent b5e678d commit 782d251

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/components/src/config/variables.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import { icons } from '@suite-common/icons/src/icons';
2+
import { breakpoints } from '@trezor/theme';
23

34
/**
4-
* @deprecated This key is deprecated. Please use `useLayoutSize` hook.
5+
* @deprecated This key is deprecated. Please use `useLayoutSize` hook or breakpoints from `@trezor/theme`.
56
*/
67
export const SCREEN_SIZE = {
7-
UNAVAILABLE: '260px',
8-
SM: '576px', // phones
9-
MD: '768px', // tablets
10-
LG: '992px', // laptops/desktops
11-
XL: '1200px', // extra Large laptops/desktops
8+
UNAVAILABLE: `${breakpoints.unavailable}px`,
9+
SM: `${breakpoints.mobile}px`,
10+
MD: `${breakpoints.tablet}px`,
11+
LG: `${breakpoints.laptop}px`,
12+
XL: `${breakpoints.desktop}px`,
1213
} as const;
1314

14-
// Temporary solution to enable the simultaneous use of above and below breakpoints, ideally SCREEN SIZE should be just numbers IMO
1515
const HELPER_SCREEN_SIZE = {
16-
SM: '575px', // phones
17-
MD: '767px', // tablets
18-
LG: '991px', // laptops/desktops
19-
XL: '1199px', // extra Large laptops/desktops
16+
SM: `${breakpoints.mobile - 1}px`,
17+
MD: `${breakpoints.tablet - 1}px`,
18+
LG: `${breakpoints.laptop - 1}px`,
19+
XL: `${breakpoints.desktop - 1}px`,
2020
};
2121

2222
/**
23-
* @deprecated This key is deprecated. Please use `useLayoutSize` hook.
23+
* @deprecated This key is deprecated. Please use `useLayoutSize` hook or breakpoints from `@trezor/theme`.
2424
*/
2525
export const SCREEN_QUERY = {
2626
MOBILE: `@media (max-width: ${HELPER_SCREEN_SIZE.SM})`,

0 commit comments

Comments
 (0)