From 98e1cb2eff4fc76d7ff1f8aa2bd37448267bfb21 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Wed, 10 Sep 2025 00:53:16 +0200 Subject: [PATCH] Reuse SplashScreen on LoginPage --- .../components/SplashScreen.tsx | 27 ++++++++-- .../authentication/screens/LoginPage.tsx | 49 +++++++++---------- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/src/features/authentication/components/SplashScreen.tsx b/src/features/authentication/components/SplashScreen.tsx index 20ac60d9..7cdd66e4 100644 --- a/src/features/authentication/components/SplashScreen.tsx +++ b/src/features/authentication/components/SplashScreen.tsx @@ -7,16 +7,26 @@ */ import { useTheme } from '@mui/material/styles'; -import Stack from '@mui/material/Stack'; +import Stack, { StackProps } from '@mui/material/Stack'; +import { ComponentProps } from 'react'; import { SuwayomiLogo } from '@/assets/SuwayomiLogo.tsx'; import { ServerAddressSetting } from '@/features/settings/components/ServerAddressSetting.tsx'; import { ThemeMode } from '@/features/theme/AppThemeContext.tsx'; -export const SplashScreen = () => { +export const SplashScreen = ({ + slots, +}: { + slots?: { + stackProps?: StackProps; + logoProps?: ComponentProps; + serverAddressProps?: StackProps; + }; +}) => { const theme = useTheme(); return ( { ...theme.applyStyles('dark', { backgroundColor: 'primary.dark', }), + ...slots?.stackProps?.sx, }} > - + diff --git a/src/features/authentication/screens/LoginPage.tsx b/src/features/authentication/screens/LoginPage.tsx index cc4f2a91..dc3e7f80 100644 --- a/src/features/authentication/screens/LoginPage.tsx +++ b/src/features/authentication/screens/LoginPage.tsx @@ -19,11 +19,11 @@ import { requestManager } from '@/lib/requests/RequestManager.ts'; import { makeToast } from '@/base/utils/Toast.ts'; import { getErrorMessage } from '@/lib/HelperFunctions.ts'; import { AuthManager } from '@/features/authentication/AuthManager.ts'; -import { SuwayomiLogo } from '@/assets/SuwayomiLogo.tsx'; import { useSessionContext } from '@/features/authentication/SessionContext.tsx'; import { AppRoutes } from '@/base/AppRoute.constants.ts'; import { useNavBarContext } from '@/features/navigation-bar/NavbarContext.tsx'; import { SearchParam } from '@/base/Base.types.ts'; +import { SplashScreen } from '@/features/authentication/components/SplashScreen.tsx'; import { ServerAddressSetting } from '@/features/settings/components/ServerAddressSetting.tsx'; export const LoginPage = () => { @@ -60,7 +60,7 @@ export const LoginPage = () => { return () => setOverride({ status: false, value: null }); }, []); - if (isAuthenticated) { + if (false && isAuthenticated) { return ; } @@ -72,33 +72,28 @@ export const LoginPage = () => { }, }} > - - - + />