sixseconds-modules 1.6.44 → 1.6.46

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.
@@ -0,0 +1 @@
1
+ export * from './previousLoginBanner';
@@ -0,0 +1,8 @@
1
+ import { t } from '../../types';
2
+ interface IProps {
3
+ t: t;
4
+ router?: any;
5
+ sx?: any;
6
+ }
7
+ export declare const PreviousLoginBanner: ({ t, router, sx }: IProps) => any;
8
+ export {};
@@ -1,2 +1,2 @@
1
1
  import { IHeaderProps } from './type';
2
- export declare const Header: ({ router, frontCustomComponent, endCustomComponents, totallyEndCustomComponent, userData, interFaceLangList, centerCustomComponents, updateInterfaceLang, selectedInterFaceLang, logoutHandler, logo, isNotification, extraMenuOptions, isMenu, isAccessAppMenu, notificationAccessApps, isPreviousLoginBanner, sx, t, }: IHeaderProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Header: ({ router, frontCustomComponent, endCustomComponents, totallyEndCustomComponent, userData, interFaceLangList, centerCustomComponents, updateInterfaceLang, selectedInterFaceLang, logoutHandler, logo, isNotification, extraMenuOptions, isMenu, isAccessAppMenu, notificationAccessApps, sx, t, }: IHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -62,7 +62,6 @@ export interface IInterFaceLang {
62
62
  export interface IHeaderProps {
63
63
  t: t
64
64
  router?: any
65
- isPreviousLoginBanner?: boolean
66
65
  notificationAccessApps?: {
67
66
  name: string
68
67
  }[]
@@ -2,3 +2,4 @@ export * from './elements/';
2
2
  export * from './header/';
3
3
  export * from './inputFields/';
4
4
  export * from './buttons/';
5
+ export * from './features/';
package/dist/index.cjs.js CHANGED
@@ -10773,48 +10773,6 @@ function ChangePasswordDialog({ isOpen, email, t: t2, setInitialState }) {
10773
10773
  const IMAGES = {
10774
10774
  Us
10775
10775
  };
10776
- const PreviousLoginBanner = ({ t: t2, router }) => {
10777
- const previousLoginDetails = CookiesUtil.get("previousLoginDetails") || {};
10778
- CookiesUtil.set("previousLoginDetails", previousLoginDetails);
10779
- const handleAutoLogin = async () => {
10780
- try {
10781
- const res = await autoLoginApi(previousLoginDetails?.id);
10782
- if (res.remote === "success") {
10783
- CookiesUtil.remove("previousLoginDetails");
10784
- if (router) {
10785
- router.reload();
10786
- router.replace(ROUTES.home);
10787
- } else {
10788
- window.location.reload();
10789
- window.location.href = ROUTES.home;
10790
- }
10791
- }
10792
- } catch (err) {
10793
- toast.error(t2(ALERT_MESSAGES.fallbackError));
10794
- }
10795
- };
10796
- return previousLoginDetails.id && previousLoginDetails.isAllowToAccess && /* @__PURE__ */ jsxRuntime.jsx(
10797
- material.Box,
10798
- {
10799
- sx: {
10800
- height: "auto",
10801
- width: "100%",
10802
- backgroundColor: "#007FC0",
10803
- p: 1,
10804
- color: "#fff",
10805
- mt: "70px",
10806
- textTransform: "capitalize"
10807
- },
10808
- children: /* @__PURE__ */ jsxRuntime.jsxs(material.Typography, { variant: "h6", align: "center", children: [
10809
- "Go back to",
10810
- " ",
10811
- /* @__PURE__ */ jsxRuntime.jsx("strong", { onClick: handleAutoLogin, style: { cursor: "pointer", textDecoration: "underline" }, children: previousLoginDetails.name || previousLoginDetails.email || previousLoginDetails.id }),
10812
- " ",
10813
- "Profile"
10814
- ] })
10815
- }
10816
- );
10817
- };
10818
10776
  const Header = ({
10819
10777
  router,
10820
10778
  frontCustomComponent,
@@ -10832,7 +10790,6 @@ const Header = ({
10832
10790
  isMenu,
10833
10791
  isAccessAppMenu,
10834
10792
  notificationAccessApps,
10835
- isPreviousLoginBanner = false,
10836
10793
  sx,
10837
10794
  t
10838
10795
  }) => {
@@ -11005,7 +10962,7 @@ const Header = ({
11005
10962
  }
11006
10963
  )
11007
10964
  ] }) }),
11008
- isPreviousLoginBanner && /* @__PURE__ */ jsxRuntime.jsx(PreviousLoginBanner, { t }),
10965
+ /* @__PURE__ */ jsxRuntime.jsx(PreviousLoginBanner, { t }),
11009
10966
  /* @__PURE__ */ jsxRuntime.jsx(
11010
10967
  DangerDialog,
11011
10968
  {
@@ -11317,12 +11274,54 @@ const ButtonStyled = material.styled("div")(() => ({
11317
11274
  function Button({ isLoading = false, btnTitle, className, disabled = false, ...rest }) {
11318
11275
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(ButtonStyled, { children: /* @__PURE__ */ jsxRuntime.jsx(material.Button, { disabled, className: `btn ${className}`, ...rest, size: "small", children: isLoading ? ALERT_MESSAGES.commonLoadingMessage : btnTitle }) }) });
11319
11276
  }
11277
+ const PreviousLoginBanner = ({ t: t2, router, sx }) => {
11278
+ const previousLoginDetails = CookiesUtil.get("previousLoginDetails") || {};
11279
+ CookiesUtil.set("previousLoginDetails", previousLoginDetails);
11280
+ const handleAutoLogin = async () => {
11281
+ try {
11282
+ const res = await autoLoginApi(previousLoginDetails?.id);
11283
+ if (res.remote === "success") {
11284
+ CookiesUtil.remove("previousLoginDetails");
11285
+ if (router) {
11286
+ router.reload();
11287
+ router.replace(ROUTES.home);
11288
+ } else {
11289
+ window.location.reload();
11290
+ window.location.href = ROUTES.home;
11291
+ }
11292
+ }
11293
+ } catch (err) {
11294
+ toast.error(t2(ALERT_MESSAGES.fallbackError));
11295
+ }
11296
+ };
11297
+ return previousLoginDetails.id && previousLoginDetails.isAllowToAccess && /* @__PURE__ */ jsxRuntime.jsx(
11298
+ material.Box,
11299
+ {
11300
+ sx: {
11301
+ height: "auto",
11302
+ width: "100%",
11303
+ backgroundColor: "#007FC0",
11304
+ p: 1,
11305
+ color: "#fff",
11306
+ mt: "70px",
11307
+ textTransform: "capitalize",
11308
+ ...sx
11309
+ },
11310
+ children: /* @__PURE__ */ jsxRuntime.jsxs(material.Typography, { variant: "h6", align: "center", children: [
11311
+ "Go back to",
11312
+ " ",
11313
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { onClick: handleAutoLogin, style: { cursor: "pointer", textDecoration: "underline" }, children: previousLoginDetails.name || previousLoginDetails.email || previousLoginDetails.id }),
11314
+ " ",
11315
+ "Profile"
11316
+ ] })
11317
+ }
11318
+ );
11319
+ };
11320
11320
  const App = () => {
11321
11321
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
11322
11322
  Header,
11323
11323
  {
11324
11324
  isAccessAppMenu: true,
11325
- isPreviousLoginBanner: true,
11326
11325
  isMenu: true,
11327
11326
  updateInterfaceLang: () => {
11328
11327
  },
@@ -11473,6 +11472,7 @@ exports.DangerDialog = DangerDialog;
11473
11472
  exports.Header = Header;
11474
11473
  exports.IMAGES = IMAGES;
11475
11474
  exports.Logo = Logo;
11475
+ exports.PreviousLoginBanner = PreviousLoginBanner;
11476
11476
  exports.SVG = SVG;
11477
11477
  exports.Warning = Warning;
11478
11478
  exports.default = App;