This commit is contained in:
parent
50751e0c20
commit
b384f1b30a
2 changed files with 21 additions and 21 deletions
|
|
@ -15,7 +15,7 @@ type ThemeProviderState = {
|
|||
}
|
||||
|
||||
const initialState: ThemeProviderState = {
|
||||
theme: "system",
|
||||
theme: "dark",
|
||||
setTheme: () => null,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,29 +4,29 @@ import { ThemeProvider } from "@/context/ThemeProvider"
|
|||
import { useTheme } from "@/context/ThemeProvider"
|
||||
|
||||
const MainTemplate = (props) => {
|
||||
return (
|
||||
<ThemeProvider defaultTheme="light" storageKey="vite-ui-theme">
|
||||
<MainContent>{props.children}</MainContent>
|
||||
</ThemeProvider>
|
||||
)
|
||||
return (
|
||||
<ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
|
||||
<MainContent>{props.children}</MainContent>
|
||||
</ThemeProvider>
|
||||
)
|
||||
}
|
||||
|
||||
const MainContent = ({ children }) => {
|
||||
const { theme } = useTheme()
|
||||
const classes =
|
||||
theme === "light"
|
||||
? "min-h-screen w-full flex flex-col overflow-x-hidden mb-15"
|
||||
: "min-h-screen w-full flex flex-col overflow-x-hidden mb-15"
|
||||
const { theme } = useTheme()
|
||||
const classes =
|
||||
theme === "light"
|
||||
? "min-h-screen w-full flex flex-col overflow-x-hidden mb-15"
|
||||
: "min-h-screen w-full flex flex-col overflow-x-hidden mb-15"
|
||||
|
||||
return (
|
||||
<div className={classes}>
|
||||
<Header />
|
||||
<main className="flex-1 w-full px-2 md:px-4 flex justify-center pt-22">
|
||||
<div className="w-full max-w-3xl lg:max-w-3xl xl:max-w-3xl px-2 md:px-4 md:py-3 py-0">
|
||||
{children}
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<div className={classes}>
|
||||
<Header />
|
||||
<main className="flex-1 w-full px-2 md:px-4 flex justify-center pt-22">
|
||||
<div className="w-full max-w-3xl lg:max-w-3xl xl:max-w-3xl px-2 md:px-4 md:py-3 py-0">
|
||||
{children}
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default MainTemplate
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue