sixseconds-modules 1.1.3 → 1.1.5
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/dist/index.cjs.js +2 -42
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2 -42
- package/dist/index.es.js.map +1 -1
- package/package.json +9 -5
package/dist/index.cjs.js
CHANGED
|
@@ -3,9 +3,8 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
3
3
|
const material = require("@mui/material");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const axios = require("axios");
|
|
6
|
-
const reactRedux = require("react-redux");
|
|
7
|
-
const toolkit = require("@reduxjs/toolkit");
|
|
8
6
|
const CheckIcon = require("@mui/icons-material/Check");
|
|
7
|
+
const reactRedux = require("react-redux");
|
|
9
8
|
const HeaderStyled = material.styled("div")(() => ({
|
|
10
9
|
"& .SubHeader ": {
|
|
11
10
|
background: "#fff",
|
|
@@ -198,27 +197,6 @@ async function getUserDetails() {
|
|
|
198
197
|
});
|
|
199
198
|
return response;
|
|
200
199
|
}
|
|
201
|
-
const transformUser = (userData) => {
|
|
202
|
-
const data = userData?.data?.data;
|
|
203
|
-
const { user, additional_data } = data;
|
|
204
|
-
return {
|
|
205
|
-
name: user?.Name,
|
|
206
|
-
email: user?.Email,
|
|
207
|
-
user_profile: additional_data?.user_profile
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
const initialState$1 = {};
|
|
211
|
-
const UserProfileSlice = toolkit.createSlice({
|
|
212
|
-
name: "UserProfile",
|
|
213
|
-
initialState: initialState$1,
|
|
214
|
-
reducers: {
|
|
215
|
-
setUserProfile: (_, action) => {
|
|
216
|
-
return action.payload;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
const { setUserProfile } = UserProfileSlice.actions;
|
|
221
|
-
UserProfileSlice.reducer;
|
|
222
200
|
const NotificationModal = () => {
|
|
223
201
|
const notifications = [
|
|
224
202
|
{
|
|
@@ -530,38 +508,20 @@ const useClickModals = (ref, callback) => {
|
|
|
530
508
|
};
|
|
531
509
|
}, [ref, callback]);
|
|
532
510
|
};
|
|
533
|
-
const initialState = {
|
|
534
|
-
isSSoFlag: false
|
|
535
|
-
};
|
|
536
|
-
const SsoAppSlice = toolkit.createSlice({
|
|
537
|
-
name: "SSO_App",
|
|
538
|
-
initialState,
|
|
539
|
-
reducers: {
|
|
540
|
-
setIsSSOFlag: (state, action) => {
|
|
541
|
-
state.isSSoFlag = action.payload;
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
});
|
|
545
|
-
const { setIsSSOFlag } = SsoAppSlice.actions;
|
|
546
|
-
SsoAppSlice.reducer;
|
|
547
511
|
const App = ({ desktopCollapsed }) => {
|
|
548
|
-
const dispatch = reactRedux.useDispatch();
|
|
549
512
|
const [openModal, setOpenModal] = react.useState(null);
|
|
550
513
|
const modalRef = react.useRef(null);
|
|
551
514
|
useClickModals(modalRef, () => setOpenModal(null));
|
|
552
515
|
const getUserProfileDetails = async () => {
|
|
553
516
|
try {
|
|
554
517
|
const response = await getUserDetails();
|
|
555
|
-
dispatch(setUserProfile(transformUser(response)));
|
|
556
518
|
} catch (error) {
|
|
557
519
|
console.log(error);
|
|
558
520
|
}
|
|
559
521
|
};
|
|
560
522
|
react.useEffect(() => {
|
|
561
523
|
const currentUrl = window.location.href;
|
|
562
|
-
if (currentUrl.includes("sso") || currentUrl.includes("localhost"))
|
|
563
|
-
dispatch(setIsSSOFlag(true));
|
|
564
|
-
}
|
|
524
|
+
if (currentUrl.includes("sso") || currentUrl.includes("localhost")) ;
|
|
565
525
|
console.log(window.location.href, "locationTEST");
|
|
566
526
|
getUserProfileDetails();
|
|
567
527
|
}, []);
|