Skip to content

Commit

Permalink
fix: theme provider
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Feb 17, 2024
1 parent a84cb55 commit cc58472
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { ScrollTop } from '~/components/common/ScrollTop'
import { Root } from '~/components/layout/root/Root'
import { AccentColorStyleInjector } from '~/components/modules/shared/AccentColorStyleInjector'
import { SearchPanelWithHotKey } from '~/components/modules/shared/SearchFAB'
import { Theme } from '~/components/modules/shared/Theme'
import { TocAutoScroll } from '~/components/modules/toc/TocAutoScroll'
import { attachUAAndRealIp } from '~/lib/attach-ua'
import { sansFont, serifFont } from '~/lib/fonts'
Expand Down Expand Up @@ -147,7 +146,6 @@ export default async function RootLayout(props: PropsWithChildren) {
suppressHydrationWarning
>
<head>
<Theme />
<Global />
<SayHi />
<HydrationEndDetector />
Expand Down
2 changes: 0 additions & 2 deletions src/app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import type { Viewport } from 'next'

import { MainLayout } from '~/components/modules/dashboard/layouts'
import { AccentColorStyleInjector } from '~/components/modules/shared/AccentColorStyleInjector'
import { Theme } from '~/components/modules/shared/Theme'
import { FABContainer } from '~/components/ui/fab'

export function generateViewport(): Viewport {
Expand Down Expand Up @@ -45,7 +44,6 @@ export default async function RootLayout({ children }: PropsWithChildren) {
return (
<html lang="zh-CN" suppressHydrationWarning>
<head>
<Theme />
<title>Shiro · Light Dashboard | Powered by Mix Space</title>
<HydrationEndDetector />
<AccentColorStyleInjector />
Expand Down
11 changes: 0 additions & 11 deletions src/components/modules/shared/Theme.tsx

This file was deleted.

2 changes: 2 additions & 0 deletions src/providers/root/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from './react-query-provider'
import { Provider as BalancerProvider } from 'react-wrap-balancer'
import { LazyMotion } from 'framer-motion'
import { ThemeProvider } from 'next-themes'
import type { PropsWithChildren } from 'react'

import { ModalStackProvider } from '~/components/ui/modal'
Expand All @@ -24,6 +25,7 @@ const loadFeatures = () =>
import('./framer-lazy-feature').then((res) => res.default)

const baseContexts: JSX.Element[] = [
<ThemeProvider key="themeProvider" />,
<JotaiStoreProvider key="jotaiStoreProvider" />,

<BalancerProvider key="balancerProvider" />,
Expand Down

0 comments on commit cc58472

Please sign in to comment.