l-min-components 1.7.1355 → 1.7.1357
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
|
@@ -142,6 +142,8 @@ const AppMainLayout = ({ children }) => {
|
|
|
142
142
|
handleGetDefaultAccount,
|
|
143
143
|
user,
|
|
144
144
|
userDetails,
|
|
145
|
+
handleGetFileStorageSummary,
|
|
146
|
+
getFileStorageSummaryData,
|
|
145
147
|
} = useHeader({ default: true });
|
|
146
148
|
|
|
147
149
|
// get current default account and store in cookie (from api);
|
|
@@ -314,6 +316,14 @@ const AppMainLayout = ({ children }) => {
|
|
|
314
316
|
|
|
315
317
|
const [isAffiliateLoading, setIsAffiliateLoading] = useState(true);
|
|
316
318
|
|
|
319
|
+
useEffect(() => {
|
|
320
|
+
if (generalData?.selectedAccount?.type) {
|
|
321
|
+
handleGetFileStorageSummary(
|
|
322
|
+
generalData?.selectedAccount?.type?.toLowerCase()
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
}, [generalData?.selectedAccount]);
|
|
326
|
+
|
|
317
327
|
return (
|
|
318
328
|
<OutletContext.Provider
|
|
319
329
|
value={{
|
|
@@ -349,6 +359,10 @@ const AppMainLayout = ({ children }) => {
|
|
|
349
359
|
notificationMarkReadData,
|
|
350
360
|
handleGetNotificationMarkRead,
|
|
351
361
|
planState,
|
|
362
|
+
storageSummary: {
|
|
363
|
+
...getFileStorageSummaryData?.data,
|
|
364
|
+
results: undefined,
|
|
365
|
+
},
|
|
352
366
|
}}
|
|
353
367
|
>
|
|
354
368
|
{/* display mobile layout on device width*/}
|
|
@@ -382,7 +382,23 @@ const useHeader = (props = { default: false }) => {
|
|
|
382
382
|
}
|
|
383
383
|
};
|
|
384
384
|
|
|
385
|
+
const [{ ...getFileStorageSummaryData }, getFileStorageSummary] = useAxios(
|
|
386
|
+
{ method: "GET" },
|
|
387
|
+
{ manual: true }
|
|
388
|
+
);
|
|
389
|
+
const handleGetFileStorageSummary = async (accountType) => {
|
|
390
|
+
try {
|
|
391
|
+
await getFileStorageSummary({
|
|
392
|
+
url: `/media/v1/${accountType}/filemanager/overview/`,
|
|
393
|
+
});
|
|
394
|
+
} catch (error) {
|
|
395
|
+
console.log(err);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
|
|
385
399
|
return {
|
|
400
|
+
handleGetFileStorageSummary,
|
|
401
|
+
getFileStorageSummaryData,
|
|
386
402
|
handleGetUserDetails,
|
|
387
403
|
userDetails,
|
|
388
404
|
user: userDetails.data,
|