使用cookie管理会话主题,并修复深色主题初始化的BUG

This commit is contained in:
tangly1024
2021-11-03 14:00:48 +08:00
parent e863215325
commit 58109ee4cd
5 changed files with 39 additions and 20 deletions

View File

@@ -17,7 +17,7 @@ import { ThemeProvider } from '@/lib/theme'
const Ackee = dynamic(() => import('@/components/Ackee'), { ssr: false })
const Gtag = dynamic(() => import('@/components/Gtag'), { ssr: false })
function MyApp ({ Component, pageProps }) {
const MyApp = ({ Component, pageProps }) => {
return (
<LocaleProvider>
<ThemeProvider>

View File

@@ -25,7 +25,7 @@ export async function getStaticProps () {
}
}
const index = ({ posts, tags, meta }) => {
const Index = ({ posts, tags, meta }) => {
return (
<BaseLayout meta={meta} tags={tags}>
<div className='flex-grow'>
@@ -36,4 +36,4 @@ const index = ({ posts, tags, meta }) => {
)
}
export default index
export default Index