From 4347f8d5e7f9bd8a19860a576a5998f03b894845 Mon Sep 17 00:00:00 2001 From: Riddhiagrawal001 <50551695+Riddhiagrawal001@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:08:44 +0530 Subject: [PATCH] fix: pageloader wrapper error case logout button addition (#780) --- src/entryPoints/HyperSwitchApp.res | 2 +- src/screens/Utils/DefaultLandingPage.res | 18 +++++++++++++++++- src/screens/Utils/PageLoaderWrapper.res | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/entryPoints/HyperSwitchApp.res b/src/entryPoints/HyperSwitchApp.res index b1f1908e9..06caef1aa 100644 --- a/src/entryPoints/HyperSwitchApp.res +++ b/src/entryPoints/HyperSwitchApp.res @@ -196,7 +196,7 @@ let make = () => { React.null } <> - +
{switch dashboardPageState { | #POST_LOGIN_QUES_NOT_DONE => diff --git a/src/screens/Utils/DefaultLandingPage.res b/src/screens/Utils/DefaultLandingPage.res index c94a803c3..1b0bd1f7f 100644 --- a/src/screens/Utils/DefaultLandingPage.res +++ b/src/screens/Utils/DefaultLandingPage.res @@ -10,10 +10,18 @@ let make = ( ~onClickHandler=_ => (), ~overriddingStylesTitle="", ~overriddingStylesSubtitle="", + ~showLogoutButton=false, ) => { open UIUtils let appliedWidth = width === "98%" ? "98%" : width let appliedHeight = height === "100%" ? "100%" : height + + let {setAuthStatus} = React.useContext(AuthInfoProvider.authStatusContext) + + let onLogoutHandle = () => { + setAuthStatus(LoggedOut) + } +
@@ -28,10 +36,18 @@ let make = (
-
+
diff --git a/src/screens/Utils/PageLoaderWrapper.res b/src/screens/Utils/PageLoaderWrapper.res index aa8f3193c..62b21f67c 100644 --- a/src/screens/Utils/PageLoaderWrapper.res +++ b/src/screens/Utils/PageLoaderWrapper.res @@ -31,6 +31,7 @@ let make = ( ~sectionHeight="h-80-vh", ~customStyleForDefaultLandingPage="", ~customLoader=?, + ~showLogoutButton=false, ) => { switch screenState { | Loading => @@ -48,6 +49,7 @@ let make = ( subtitle="We apologize for the inconvenience, but it seems like we encountered a hiccup while processing your request." onClickHandler={_ => Window.Location.hardReload(true)} isButton=true + showLogoutButton /> | Success => switch children {