Skip to content

Commit fd5fbfb

Browse files
seibei-iguchiAdam Havel
authored andcommitted
chore(suite): update NotificationDropdown
1 parent c012025 commit fd5fbfb

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

packages/suite/src/components/suite/layouts/SuiteLayout/Sidebar/NotificationDropdown.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { useRef, useCallback } from 'react';
22

33
import styled, { css } from 'styled-components';
44

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';
77
import { analytics, EventType } from '@trezor/suite-analytics';
88
import { notificationsActions } from '@suite-common/toast-notifications';
99

@@ -12,15 +12,6 @@ import { useDispatch } from 'src/hooks/suite';
1212

1313
import { NavigationItem, NavigationItemProps } from './NavigationItem';
1414

15-
const NotificationsWrapper = styled.div`
16-
width: 450px;
17-
cursor: default;
18-
19-
${breakpointMediaQueries.below_lg} {
20-
width: 330px;
21-
}
22-
`;
23-
2415
const StyledNavigationItem = styled(NavigationItem)`
2516
${({ theme, isActive }) =>
2617
isActive &&
@@ -31,8 +22,8 @@ const StyledNavigationItem = styled(NavigationItem)`
3122
`;
3223

3324
export const NotificationDropdown = (props: NavigationItemProps) => {
25+
const isBelowLaptop = useMediaQuery(`(max-width: ${variables.SCREEN_SIZE.LG})`);
3426
const dropdownRef = useRef<DropdownRef>();
35-
3627
const dispatch = useDispatch();
3728

3829
const handleToggleChange = useCallback(
@@ -59,9 +50,9 @@ export const NotificationDropdown = (props: NavigationItemProps) => {
5950
alignMenu="right-top"
6051
offsetY={-12}
6152
content={
62-
<NotificationsWrapper>
53+
<Box width={isBelowLaptop ? 330 : 450} margin={spacings.xs}>
6354
<Notifications onCancel={() => dropdownRef.current!.close()} />
64-
</NotificationsWrapper>
55+
</Box>
6556
}
6657
>
6758
{isToggled => <StyledNavigationItem {...props} isActive={isToggled} />}

packages/suite/src/components/suite/notifications/Notifications/NotificationGroup/NotificationGroup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const NotificationGroup = (props: NotificationGroupProps) => {
2020

2121
if (unseenCount === 0 && seenCount === 0) {
2222
return (
23-
<Column gap={spacings.xs}>
23+
<Column gap={spacings.xxs}>
2424
<H4>
2525
<Translation id="NOTIFICATIONS_EMPTY_TITLE" />
2626
</H4>
@@ -34,7 +34,7 @@ export const NotificationGroup = (props: NotificationGroupProps) => {
3434
return (
3535
<Column gap={spacings.xl}>
3636
{unseenCount > 0 && (
37-
<Column gap={spacings.md}>
37+
<Column gap={spacings.sm}>
3838
<H4>
3939
<Translation
4040
id="NOTIFICATIONS_UNSEEN_TITLE"
@@ -46,7 +46,7 @@ export const NotificationGroup = (props: NotificationGroupProps) => {
4646
)}
4747

4848
{seenCount > 0 && (
49-
<Column gap={spacings.md}>
49+
<Column gap={spacings.sm}>
5050
<H4>
5151
<Translation id="NOTIFICATIONS_SEEN_TITLE" />
5252
</H4>

0 commit comments

Comments
 (0)