From 215a01606f7739f14a272b42ad5b5b03641807d4 Mon Sep 17 00:00:00 2001 From: Simon Grimme Date: Tue, 14 May 2024 16:15:25 +0200 Subject: [PATCH] Fix theme selection bug Fix bug with login view redirection --- .run/UI debug.run.xml | 2 +- frontend/App.tsx | 2 +- frontend/components/theming/ThemePreview.tsx | 11 +++++------ frontend/components/wizard/Wizard.tsx | 2 +- frontend/index.html | 2 +- frontend/views/LoginView.tsx | 16 +++++++++------- frontend/views/SetupView.tsx | 9 +++++---- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.run/UI debug.run.xml b/.run/UI debug.run.xml index b656b83..0a58cbb 100644 --- a/.run/UI debug.run.xml +++ b/.run/UI debug.run.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/frontend/App.tsx b/frontend/App.tsx index 5c1ced5..a36b11b 100644 --- a/frontend/App.tsx +++ b/frontend/App.tsx @@ -12,7 +12,7 @@ export default function App() { return ( - + diff --git a/frontend/components/theming/ThemePreview.tsx b/frontend/components/theming/ThemePreview.tsx index f648c6c..353143f 100644 --- a/frontend/components/theming/ThemePreview.tsx +++ b/frontend/components/theming/ThemePreview.tsx @@ -9,12 +9,11 @@ export default function ThemePreview({theme, mode, isSelected}: { }) { return ( {theme.name?.replace("-", " ")}

} placement="bottom"> - - - +
); } diff --git a/frontend/components/wizard/Wizard.tsx b/frontend/components/wizard/Wizard.tsx index b0779d6..1b799bb 100644 --- a/frontend/components/wizard/Wizard.tsx +++ b/frontend/components/wizard/Wizard.tsx @@ -69,7 +69,7 @@ const Wizard = ({children, initialValues, onSubmit}: {
{step}
-
+
diff --git a/frontend/views/SetupView.tsx b/frontend/views/SetupView.tsx index b4498bd..84a642f 100644 --- a/frontend/views/SetupView.tsx +++ b/frontend/views/SetupView.tsx @@ -39,12 +39,12 @@ function WelcomeStep() { function ThemeStep() { const {theme, setTheme} = useTheme(); const [isSelected, setIsSelected] = useState(theme ? theme.includes("light") : false); - const [currentTheme, setCurrentTheme] = useState(theme?.split('-')[0]); + const [currentTheme, setCurrentTheme] = useState(theme?.substring(0, theme?.lastIndexOf("-"))); useLayoutEffect(() => setTheme(`${currentTheme}-${mode()}`), [isSelected]); function mode(): "light" | "dark" { - return !isSelected ? "dark" : "light" + return isSelected ? "light" : "dark"; } return ( @@ -61,8 +61,9 @@ function ThemeStep() { />
-
+
{ + //min-w-[468px] themes.map(((t: Theme) => (
( -
+