l-min-components 1.0.705 → 1.0.708

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.
@@ -174,6 +174,26 @@ const handleGetNotificationMarkRead = async () => {
174
174
  }
175
175
  };
176
176
 
177
+ //GET current subscription
178
+ const [{ ...getCurrentSubscriptionData }, getCurrentSubscription] = useAxios(
179
+ {
180
+ method: "GET",
181
+ },
182
+ {
183
+ manual: true,
184
+ }
185
+ );
186
+
187
+ const handleCurrentSubscription = async () => {
188
+ try {
189
+ await getCurrentSubscription({
190
+ url: `/payment/v1/current_subscription/`,
191
+ });
192
+ } catch (err) {
193
+ console.log(err);
194
+ }
195
+ };
196
+
177
197
  return {
178
198
  handleGetUserDetails,
179
199
  userDetails,
@@ -194,6 +214,8 @@ const handleGetNotificationMarkRead = async () => {
194
214
 
195
215
  userPlanData,
196
216
  handleGetUserPlan,
217
+ getCurrentSubscriptionData,
218
+ handleCurrentSubscription
197
219
  };
198
220
  };
199
221
  export default useHeader;
@@ -26,9 +26,11 @@ const SideMenu = ({
26
26
  setIsOpen,
27
27
  affiliatesActive,
28
28
  setRightComponent,
29
+ planState
29
30
  }) => {
30
31
  console.log("user type", userType);
31
32
  // const [isOpen, setIsOpen] = useState(false);
33
+ const [gracePeriod, setGracePeriod] = useState(true)
32
34
 
33
35
  const { setGeneralData, generalData } = useContext(OutletContext);
34
36
  const onToggle = () => {
@@ -258,6 +260,7 @@ const SideMenu = ({
258
260
  };
259
261
  const active = handlePathCheck();
260
262
 
263
+
261
264
  return (
262
265
  <NavigationItemContainer
263
266
  onClick={() => {
@@ -289,7 +292,7 @@ const SideMenu = ({
289
292
  }}
290
293
  // to={route.path}
291
294
  key={index}
292
- className={cx(`${route.text} ${active ? "active" : ""}`)}
295
+ className={cx(`${route.text} ${active && planState !== "GRACE PERIOD" ? "active" : active && planState === "GRACE PERIOD" ? "grace_period_active" : "grace_period"}`)}
293
296
  minimal={isOpen}
294
297
  >
295
298
  <IconContainer active={active}>
@@ -308,7 +311,7 @@ const SideMenu = ({
308
311
  };
309
312
 
310
313
  return (
311
- <SideMenuContainer isOpen={isOpen}>
314
+ <SideMenuContainer isOpen={isOpen} className={planState === "GRACE PERIOD" ? "grace_period disabled" : ""}>
312
315
  <UserCard user={user} isOpen={isOpen} />
313
316
 
314
317
  <NavigationContainer>
@@ -18,6 +18,11 @@ export const SideMenuContainer = styled.div`
18
18
  border-radius: 30px;
19
19
  margin-left: 77px;
20
20
 
21
+ &.disabled {
22
+ pointer-events: none;
23
+
24
+ }
25
+
21
26
  .toggle {
22
27
  width: 20px;
23
28
  height: 20px;
@@ -31,6 +36,13 @@ export const SideMenuContainer = styled.div`
31
36
  right: -13px;
32
37
  color: #fdcf04;
33
38
  }
39
+
40
+ /* GRACE PERIOD AND DEACTIVATE */
41
+ &.grace_period {
42
+ border-radius: 30px;
43
+ background: var(--Neutral-30, #c6cccc);
44
+ /* color: #fff; */
45
+ }
34
46
  `;
35
47
 
36
48
  export const NavigationContainer = styled.div`
@@ -49,7 +61,9 @@ export const NavigationItemContainer = styled.p`
49
61
  position: relative;
50
62
  padding: ${({ minimal }) => (minimal ? "12px 16px" : "12px 12px")};
51
63
  color: ${({ active }) =>
52
- active ? "rgb(255, 255, 255) !important" : "rgba(255, 255, 255, 0.625) !important"};
64
+ active
65
+ ? "rgb(255, 255, 255) !important"
66
+ : "rgba(255, 255, 255, 0.625) !important"};
53
67
  &:hover {
54
68
  color: #ffffff !important;
55
69
  background-color: #31cdcd;
@@ -75,6 +89,30 @@ export const NavigationItemContainer = styled.p`
75
89
  background: #febf10;
76
90
  }
77
91
  }
92
+
93
+
94
+ /* GRACE PERIOD AND DEACTIVATED */
95
+ &.grace_period{
96
+ background: var(--Neutral-40, #ADB2B2);
97
+ margin: 2px 0px;
98
+ }
99
+
100
+ &.grace_period_active {
101
+ background: var(--Neutral-50, #949999);
102
+ color: #ffffff;
103
+ margin: 2px 0px;
104
+ &::before {
105
+ content: "";
106
+ height: 110%;
107
+ width: 5px;
108
+ border-radius: 0 10px 10px 0;
109
+ position: absolute;
110
+ top: -5%;
111
+ left: 0;
112
+ display: block;
113
+ background: #949999;
114
+ }
115
+ }
78
116
  `;
79
117
 
80
118
  export const IconContainer = styled.div`