From ae467ab20de766144b15c08fceb7d92401e27465 Mon Sep 17 00:00:00 2001 From: Fran McDade Date: Thu, 31 Oct 2024 11:15:17 +1000 Subject: [PATCH] feat: updated authentication pending status (#178) --- .../Authentication/authentication.tsx | 19 +++++++-- .../authenticationMenu.styles.ts | 4 +- .../AuthenticationMenu/authenticationMenu.tsx | 4 +- .../components/Button/button.styles.ts | 5 ++- .../Layout/components/Header/header.tsx | 2 +- .../SessionTimeout/sessionTimeout.tsx | 2 +- src/hooks/authentication/profile/types.ts | 1 + .../authentication/profile/useProfile.ts | 8 +++- .../session/useSessionActive.ts | 2 +- .../session/useSessionCallbackUrl.ts | 23 ++-------- .../session/useSessionIdleTimer.ts | 10 +++++ .../session/useSessionTimeout.ts | 42 ++++++++++++++++--- src/hooks/useRouteHistory.ts | 14 ++++--- src/hooks/useRouteRoot.ts | 11 +++++ src/hooks/useSessionTimeout.ts | 40 ------------------ .../googleSignInAuthentication/provider.tsx | 4 +- .../service/service.ts | 2 +- .../nextAuthAuthentication/provider.tsx | 4 +- 18 files changed, 108 insertions(+), 89 deletions(-) create mode 100644 src/hooks/authentication/session/useSessionIdleTimer.ts create mode 100644 src/hooks/useRouteRoot.ts delete mode 100644 src/hooks/useSessionTimeout.ts diff --git a/src/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.tsx b/src/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.tsx index ad0b2b03..453b595d 100644 --- a/src/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.tsx +++ b/src/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/authentication.tsx @@ -3,11 +3,13 @@ import { ButtonProps as MButtonProps, IconButton as MIconButton, IconButtonProps as MIconButtonProps, + Skeleton, } from "@mui/material"; import Router from "next/router"; import React, { ElementType } from "react"; import { useProfile } from "../../../../../../../../../../hooks/authentication/profile/useProfile"; import { ROUTE } from "../../../../../../../../../../routes/constants"; +import { isNavigationLinkSelected } from "../../../Navigation/common/utils"; import { AuthenticationMenu } from "./components/AuthenticationMenu/authenticationMenu"; import { StyledButton } from "./components/Button/button.styles"; @@ -22,8 +24,9 @@ export const Authentication = ({ Button, closeMenu, }: AuthenticationProps): JSX.Element | null => { - const { profile } = useProfile(); + const { isLoading, profile } = useProfile(); if (!authenticationEnabled) return null; + if (isLoading) return ; if (profile) return ; return (