@@ -2,8 +2,8 @@ import { useRef, useCallback } from 'react';
2
2
3
3
import styled , { css } from 'styled-components' ;
4
4
5
- import { breakpointMediaQueries } from '@trezor/styles ' ;
6
- import { DropdownRef , Dropdown } from '@trezor/components ' ;
5
+ import { DropdownRef , Dropdown , Box , useMediaQuery , variables } from '@trezor/components ' ;
6
+ import { spacings } from '@trezor/theme ' ;
7
7
import { analytics , EventType } from '@trezor/suite-analytics' ;
8
8
import { notificationsActions } from '@suite-common/toast-notifications' ;
9
9
@@ -12,15 +12,6 @@ import { useDispatch } from 'src/hooks/suite';
12
12
13
13
import { NavigationItem , NavigationItemProps } from './NavigationItem' ;
14
14
15
- const NotificationsWrapper = styled . div `
16
- width : 450px ;
17
- cursor : default;
18
-
19
- ${ breakpointMediaQueries . below_lg } {
20
- width : 330px ;
21
- }
22
- ` ;
23
-
24
15
const StyledNavigationItem = styled ( NavigationItem ) `
25
16
${ ( { theme, isActive } ) =>
26
17
isActive &&
@@ -31,8 +22,8 @@ const StyledNavigationItem = styled(NavigationItem)`
31
22
` ;
32
23
33
24
export const NotificationDropdown = ( props : NavigationItemProps ) => {
25
+ const isBelowLaptop = useMediaQuery ( `(max-width: ${ variables . SCREEN_SIZE . LG } )` ) ;
34
26
const dropdownRef = useRef < DropdownRef > ( ) ;
35
-
36
27
const dispatch = useDispatch ( ) ;
37
28
38
29
const handleToggleChange = useCallback (
@@ -59,9 +50,9 @@ export const NotificationDropdown = (props: NavigationItemProps) => {
59
50
alignMenu = "right-top"
60
51
offsetY = { - 12 }
61
52
content = {
62
- < NotificationsWrapper >
53
+ < Box width = { isBelowLaptop ? 330 : 450 } margin = { spacings . xs } >
63
54
< Notifications onCancel = { ( ) => dropdownRef . current ! . close ( ) } />
64
- </ NotificationsWrapper >
55
+ </ Box >
65
56
}
66
57
>
67
58
{ isToggled => < StyledNavigationItem { ...props } isActive = { isToggled } /> }
0 commit comments