@omniumretail/component-library 1.2.48 → 1.2.49
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.
package/package.json
CHANGED
|
@@ -33,6 +33,18 @@ export const BellNotifications = ({ notifications, onFilterChange, onNotificatio
|
|
|
33
33
|
const { t } = useTranslation();
|
|
34
34
|
const [filter, setFilter] = useState<'all' | 'unread'>('all');
|
|
35
35
|
const [isShaking, setIsShaking] = useState(false);
|
|
36
|
+
const [isMobile, setIsMobile] = useState(window.innerWidth < 768);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
const handleResize = () => {
|
|
40
|
+
setIsMobile(window.innerWidth < 768);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
window.addEventListener('resize', handleResize);
|
|
44
|
+
return () => {
|
|
45
|
+
window.removeEventListener('resize', handleResize);
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
36
48
|
|
|
37
49
|
const unreadCount = notifications.filter((notif) => !notif.IsRead).length;
|
|
38
50
|
|
|
@@ -131,7 +143,7 @@ export const BellNotifications = ({ notifications, onFilterChange, onNotificatio
|
|
|
131
143
|
);
|
|
132
144
|
|
|
133
145
|
return (
|
|
134
|
-
<Dropdown placement='topRight' overlayClassName={styles.dropdownContainer} overlay={menu} trigger={['click']}>
|
|
146
|
+
<Dropdown placement={isMobile ? undefined : 'topRight'} overlayClassName={styles.dropdownContainer} overlay={menu} trigger={['click']}>
|
|
135
147
|
<Badge count={unreadCount} className={styles.badgeStyle} overflowCount={99}>
|
|
136
148
|
<BellOutlined className={`${styles.bellIcon} ${isShaking ? styles.shake : ''}`} />
|
|
137
149
|
</Badge>
|