@homefile/components-v2 2.14.14 → 2.14.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,7 +9,11 @@ import { MOBILE_WIDTH } from '../../utils';
|
|
|
9
9
|
export const NotificationsReminder = ({ onClick, total }) => {
|
|
10
10
|
const { windowDimensions: { width }, } = useWindowDimensions();
|
|
11
11
|
const isMobile = width < MOBILE_WIDTH;
|
|
12
|
-
|
|
12
|
+
const hasNotifications = total > 0;
|
|
13
|
+
const bg = hasNotifications
|
|
14
|
+
? 'linear-gradient(120deg, #0b8dd7, #730bd7, #0bd7ac)'
|
|
15
|
+
: 'blue.4';
|
|
16
|
+
return (_jsx(Tooltip, { label: t('tooltips.notifications'), children: _jsx(Box, { id: "notificationsRemember", "data-testid": "notifications-reminder", children: _jsxs(Flex, { gap: "1", as: "button", onClick: onClick, children: [_jsx(Img, { src: Speaker, "aria-label": t('tooltips.notifications'), h: "26px", w: "auto" }), !isMobile && (_jsx(NumberBadge, { total: total, background: bg, backgroundSize: 100, animation: `${bgGradient} 6s linear infinite` }))] }) }) }));
|
|
13
17
|
};
|
|
14
18
|
const bgGradient = keyframes `
|
|
15
19
|
0% {
|
package/package.json
CHANGED
|
@@ -12,6 +12,10 @@ export const NotificationsReminder = ({ onClick, total }: AppBarIconI) => {
|
|
|
12
12
|
windowDimensions: { width },
|
|
13
13
|
} = useWindowDimensions()
|
|
14
14
|
const isMobile = width < MOBILE_WIDTH
|
|
15
|
+
const hasNotifications = total > 0
|
|
16
|
+
const bg = hasNotifications
|
|
17
|
+
? 'linear-gradient(120deg, #0b8dd7, #730bd7, #0bd7ac)'
|
|
18
|
+
: 'blue.4'
|
|
15
19
|
return (
|
|
16
20
|
<Tooltip label={t('tooltips.notifications')}>
|
|
17
21
|
<Box id="notificationsRemember" data-testid="notifications-reminder">
|
|
@@ -25,7 +29,7 @@ export const NotificationsReminder = ({ onClick, total }: AppBarIconI) => {
|
|
|
25
29
|
{!isMobile && (
|
|
26
30
|
<NumberBadge
|
|
27
31
|
total={total}
|
|
28
|
-
background=
|
|
32
|
+
background={bg}
|
|
29
33
|
backgroundSize={100}
|
|
30
34
|
animation={`${bgGradient} 6s linear infinite`}
|
|
31
35
|
/>
|