l-min-components 1.0.650 → 1.0.652

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.0.650",
3
+ "version": "1.0.652",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -30,3 +30,33 @@ export const NotificationIcon = ({ width, height, fill }) => (
30
30
  <circle cx="17.1797" cy="5" r="4.5" fill="#F39B33" stroke="white" />
31
31
  </svg>
32
32
  );
33
+ export const NotificationEmptyIcon = ({ width, height, fill }) => (
34
+ <svg
35
+ width={width || "23"}
36
+ height={height || "23"}
37
+ viewBox="0 0 23 23"
38
+ fill="none"
39
+ xmlns="http://www.w3.org/2000/svg">
40
+ <path
41
+ d="M10.891 3.59375C7.94042 3.59375 5.54254 5.99163 5.54254 8.94218V11.5183C5.54254 12.0621 5.31077 12.8911 5.03444 13.3546L4.00932 15.0572C3.37642 16.1091 3.81321 17.2768 4.97204 17.669C8.814 18.9527 12.959 18.9527 16.801 17.669C17.8796 17.3125 18.352 16.0378 17.7637 15.0572L16.7386 13.3546C16.4712 12.8911 16.2394 12.0621 16.2394 11.5183V8.94218C16.2394 6.00055 13.8326 3.59375 10.891 3.59375Z"
42
+ stroke="#4A4D4D"
43
+ strokeWidth="1.5"
44
+ strokeMiterlimit="10"
45
+ strokeLinecap="round"
46
+ />
47
+ <path
48
+ d="M12.5404 3.85266C12.2641 3.77244 11.9788 3.71004 11.6846 3.67438C10.8289 3.56741 10.0088 3.62981 9.24219 3.85266C9.5007 3.19302 10.1425 2.72949 10.8913 2.72949C11.6401 2.72949 12.2819 3.19302 12.5404 3.85266Z"
49
+ stroke="#4A4D4D"
50
+ strokeWidth="1.5"
51
+ strokeMiterlimit="10"
52
+ strokeLinecap="round"
53
+ strokeLinejoin="round"
54
+ />
55
+ <path
56
+ d="M13.5672 17.9902C13.5672 19.4611 12.3638 20.6645 10.893 20.6645C10.162 20.6645 9.48455 20.3614 9.00319 19.88C8.52183 19.3987 8.21875 18.7212 8.21875 17.9902"
57
+ stroke="#4A4D4D"
58
+ strokeWidth="1.5"
59
+ strokeMiterlimit="10"
60
+ />
61
+ </svg>
62
+ );
@@ -68,6 +68,27 @@ const useHeader = () => {
68
68
  console.log(err);
69
69
  }
70
70
  };
71
+ const [{ ...unreadNotificationData }, getUnreadNotification] = useAxios(
72
+ {
73
+ method: "GET",
74
+ },
75
+ {
76
+ manual: true,
77
+ }
78
+ );
79
+
80
+ const handleGetUnreadNotification = async (read = false) => {
81
+ try {
82
+ await getUnreadNotification({
83
+ url: `/notify/v1/notifications/`,
84
+ params: {
85
+ read: read,
86
+ },
87
+ });
88
+ } catch (err) {
89
+ console.log(err);
90
+ }
91
+ };
71
92
 
72
93
  return {
73
94
  handleGetUserDetails,
@@ -78,6 +99,8 @@ const useHeader = () => {
78
99
  getDefaultAccount,
79
100
  handleSetDefaultAccount,
80
101
  setDefaultAccount,
102
+ unreadNotificationData,
103
+ handleGetUnreadNotification
81
104
  };
82
105
  };
83
106
  export default useHeader;
@@ -6,7 +6,7 @@ import { PeopleIcon } from "./assets/svg/people";
6
6
  import { MessageIcon } from "./assets/svg/message";
7
7
  import { SettingIcon } from "./assets/svg/setting";
8
8
  import { SearchIcon } from "./assets/svg/search";
9
- import { NotificationIcon } from "./assets/svg/notification";
9
+ import { NotificationEmptyIcon, NotificationIcon } from "./assets/svg/notification";
10
10
  import { ArrowDownIcon } from "./assets/svg/arrow-down";
11
11
  import AccountDropdown from "./account-dropdown";
12
12
  import avatar from "./assets/images/avatar.png";
@@ -48,6 +48,8 @@ const HeaderComponent = (props) => {
48
48
  userDetails,
49
49
  getDefaultAccount,
50
50
  handleGetDefaultAccount,
51
+ unreadNotificationData,
52
+ handleGetUnreadNotification
51
53
  } = useHeader();
52
54
  const { pathname } = useLocation();
53
55
  const { setGeneralData, generalData } = useContext(OutletContext);
@@ -58,6 +60,7 @@ const HeaderComponent = (props) => {
58
60
  handleGetUserAccountsDetail();
59
61
  handleGetUserDetails();
60
62
  handleGetDefaultAccount();
63
+ handleGetUnreadNotification();
61
64
  }, []);
62
65
  useEffect(() => {
63
66
  if (userAccountsDetail?.data) {
@@ -273,11 +276,22 @@ const HeaderComponent = (props) => {
273
276
  <SettingIcon /> Settings
274
277
  </a>
275
278
  </li>
276
- {/* <li>
277
- <a href="#">
278
- <NotificationIcon /> Notifications
279
+ <li>
280
+ <a
281
+ href="https://developer-staging-01.learngual.com/notifications/"
282
+ className={
283
+ window.location.pathname.includes("notifications") ? "active" : ""
284
+ }
285
+ style={{ cursor: "pointer" }}
286
+ >
287
+ {unreadNotificationData?.data?.count > 0 ? (
288
+ <NotificationIcon />
289
+ ) : (
290
+ <NotificationEmptyIcon />
291
+ )}
292
+ Notifications
279
293
  </a>
280
- </li> */}
294
+ </li>
281
295
  </Nav>
282
296
 
283
297
  <NavGroup