fix: force default light mode for public pages and admin
- Set defaultColorScheme='light' in root MantineProvider - Change darkModeStore default from system preference to false (light) - Add MantineProvider with light theme to darmasaba/layout.tsx - Remove dark mode dependency from ModuleView component - Prevent system color scheme from affecting initial page load This ensures consistent light mode on first visit for both public pages and admin panel, regardless of OS settings. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -1,25 +1,32 @@
|
||||
"use client";
|
||||
|
||||
import colors from "@/con/colors";
|
||||
import { MantineProvider, createTheme } from "@mantine/core";
|
||||
import { Box, Space, Stack } from "@mantine/core";
|
||||
|
||||
import { Navbar } from "@/app/darmasaba/_com/Navbar";
|
||||
import Footer from "./_com/Footer";
|
||||
|
||||
|
||||
const theme = createTheme({
|
||||
defaultColorScheme: "light",
|
||||
});
|
||||
|
||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<Stack gap={0} bg={colors.grey[1]}>
|
||||
<Navbar />
|
||||
<Space h={{
|
||||
base: "3.9rem",
|
||||
md: "2.5rem"
|
||||
}} />
|
||||
<Box style={{
|
||||
overflow: "scroll"
|
||||
}}>
|
||||
{children}
|
||||
</Box>
|
||||
<Footer />
|
||||
</Stack>
|
||||
<MantineProvider theme={theme} defaultColorScheme="light">
|
||||
<Stack gap={0} bg={colors.grey[1]}>
|
||||
<Navbar />
|
||||
<Space h={{
|
||||
base: "3.9rem",
|
||||
md: "2.5rem"
|
||||
}} />
|
||||
<Box style={{
|
||||
overflow: "scroll"
|
||||
}}>
|
||||
{children}
|
||||
</Box>
|
||||
<Footer />
|
||||
</Stack>
|
||||
</MantineProvider>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user