Skip to content

Commit 3c9791d

Browse files
committed
Apply liquid blue/cyan theme to all notification dropdown components - buttons and badge
1 parent b4858cb commit 3c9791d

3 files changed

Lines changed: 61 additions & 10 deletions

File tree

src/components/header/components/notificationsDropdown/NotificationsDropdown.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export const NotificationsDropdown: React.FC = () => {
106106
refreshPaymentNotifications({ filter: 'unread' });
107107
return Promise.resolve();
108108
}}
109+
onClose={() => setOpened(false)}
109110
/>
110111
</div>
111112
),
@@ -135,6 +136,7 @@ export const NotificationsDropdown: React.FC = () => {
135136
refreshReportNotifications({ filter: 'unread' });
136137
return Promise.resolve();
137138
}}
139+
onClose={() => setOpened(false)}
138140
/>
139141
</div>
140142
),
@@ -144,6 +146,7 @@ export const NotificationsDropdown: React.FC = () => {
144146
return (
145147
<S.StyledNotificationPopover
146148
trigger="click"
149+
open={isOpened}
147150
content={
148151
<S.NotificationContent>
149152
<Tabs

src/components/header/components/notificationsDropdown/PaymentNotificationsOverlay/PaymentNotificationsOverlay.tsx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useCallback } from 'react';
22
import { useTranslation } from 'react-i18next';
3-
import { Link } from 'react-router-dom';
3+
import { Link, useNavigate } from 'react-router-dom';
44
import { BaseButton } from '@app/components/common/BaseButton/BaseButton';
55
import { BaseRow } from '@app/components/common/BaseRow/BaseRow';
66
import { BaseCol } from '@app/components/common/BaseCol/BaseCol';
@@ -12,16 +12,37 @@ interface PaymentNotificationsOverlayProps {
1212
markAsRead: (id: number) => Promise<void>;
1313
markAllAsRead: () => Promise<void>;
1414
onRefresh: () => Promise<void>;
15+
onClose?: () => void;
1516
}
1617

1718
export const PaymentNotificationsOverlay: React.FC<PaymentNotificationsOverlayProps> = ({
1819
notifications,
1920
markAsRead,
2021
markAllAsRead,
2122
onRefresh,
23+
onClose,
2224
...props
2325
}) => {
2426
const { t } = useTranslation();
27+
const navigate = useNavigate();
28+
29+
const handleViewAll = useCallback(() => {
30+
if (onClose) {
31+
onClose();
32+
}
33+
setTimeout(() => {
34+
navigate('/payment-notifications');
35+
}, 0);
36+
}, [onClose, navigate]);
37+
38+
const handleViewDetails = useCallback(() => {
39+
if (onClose) {
40+
onClose();
41+
}
42+
setTimeout(() => {
43+
navigate('/payment-notifications');
44+
}, 0);
45+
}, [onClose, navigate]);
2546

2647
const formatDate = (dateString: string): string => {
2748
const date = new Date(dateString);
@@ -100,9 +121,12 @@ export const PaymentNotificationsOverlay: React.FC<PaymentNotificationsOverlayPr
100121
{t('payment.notifications.expiration', 'Expires')}: {formatDate(notification.expiration_date)}
101122
</div> */}
102123
<S.ActionRow>
103-
<Link to="/payment-notifications" style={{ fontSize: '0.85rem', color: 'rgba(255, 255, 255, 0.7)' }}>
124+
<a
125+
onClick={handleViewDetails}
126+
style={{ fontSize: '0.85rem', color: 'rgba(255, 255, 255, 0.7)', cursor: 'pointer' }}
127+
>
104128
{t('payment.notifications.viewDetails', 'View details')}
105-
</Link>
129+
</a>
106130
{!notification.is_read && (
107131
<BaseButton
108132
type="link"
@@ -164,8 +188,8 @@ export const PaymentNotificationsOverlay: React.FC<PaymentNotificationsOverlayPr
164188
</S.Btn>
165189
</BaseCol>
166190
<BaseCol span={24}>
167-
<S.Btn type="link">
168-
<Link to="/payment-notifications">{t('payment.notifications.viewAll', 'View all')}</Link>
191+
<S.Btn type="link" onClick={handleViewAll}>
192+
{t('payment.notifications.viewAll', 'View all')}
169193
</S.Btn>
170194
</BaseCol>
171195
</BaseRow>

src/components/header/components/notificationsDropdown/ReportNotificationsOverlay/ReportNotificationsOverlay.tsx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useCallback } from 'react';
22
import { useTranslation } from 'react-i18next';
3-
import { Link } from 'react-router-dom';
3+
import { Link, useNavigate } from 'react-router-dom';
44
import { BaseNotification } from '@app/components/common/BaseNotification/BaseNotification';
55
import { BaseButton } from '@app/components/common/BaseButton/BaseButton';
66
import { BaseSpace } from '@app/components/common/BaseSpace/BaseSpace';
@@ -15,16 +15,37 @@ interface ReportNotificationsOverlayProps {
1515
markAsRead: (id: number) => Promise<void>;
1616
markAllAsRead: () => Promise<void>;
1717
onRefresh: () => Promise<void>;
18+
onClose?: () => void;
1819
}
1920

2021
export const ReportNotificationsOverlay: React.FC<ReportNotificationsOverlayProps> = ({
2122
notifications,
2223
markAsRead,
2324
markAllAsRead,
2425
onRefresh,
26+
onClose,
2527
...props
2628
}) => {
2729
const { t } = useTranslation();
30+
const navigate = useNavigate();
31+
32+
const handleViewAll = useCallback(() => {
33+
if (onClose) {
34+
onClose();
35+
}
36+
setTimeout(() => {
37+
navigate('/report-notifications');
38+
}, 0);
39+
}, [onClose, navigate]);
40+
41+
const handleViewDetails = useCallback(() => {
42+
if (onClose) {
43+
onClose();
44+
}
45+
setTimeout(() => {
46+
navigate('/report-notifications');
47+
}, 0);
48+
}, [onClose, navigate]);
2849

2950
const formatDate = (dateString: string): string => {
3051
const date = new Date(dateString);
@@ -121,9 +142,12 @@ export const ReportNotificationsOverlay: React.FC<ReportNotificationsOverlayProp
121142
)}
122143

123144
<div style={{ marginTop: '4px' }}>
124-
<Link to="/report-notifications" style={{ fontSize: '0.85rem', color: 'rgba(255, 255, 255, 0.7)' }}>
145+
<a
146+
onClick={handleViewDetails}
147+
style={{ fontSize: '0.85rem', color: 'rgba(255, 255, 255, 0.7)', cursor: 'pointer' }}
148+
>
125149
{t('report.notifications.viewDetails', 'View details')}
126-
</Link>
150+
</a>
127151
</div>
128152
</div>
129153
}
@@ -167,8 +191,8 @@ export const ReportNotificationsOverlay: React.FC<ReportNotificationsOverlayProp
167191
</S.Btn>
168192
</BaseCol>
169193
<BaseCol span={24}>
170-
<S.Btn type="link">
171-
<Link to="/report-notifications">{t('report.notifications.viewAll', 'View all')}</Link>
194+
<S.Btn type="link" onClick={handleViewAll}>
195+
{t('report.notifications.viewAll', 'View all')}
172196
</S.Btn>
173197
</BaseCol>
174198
</BaseRow>

0 commit comments

Comments
 (0)