0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-12-22 20:20:09 +09:00

Revert 愚か

This commit is contained in:
yude 2021-02-06 22:06:29 +09:00
parent 9cc542ecdf
commit df9947ecf8

View File

@ -1,6 +1,6 @@
import React from 'react'
const getServerSideTheme = _ => {
const getInitialTheme = _ => {
if (typeof window !== "undefined" && window.localStorage) {
const storedPrefs = window.localStorage.getItem("color-theme")
if (typeof storedPrefs === "string") {
@ -19,10 +19,10 @@ const getServerSideTheme = _ => {
const ThemeContext = React.createContext()
export default ThemeContext
export default T
export const ThemeProvider = ({ initialTheme, children }) => {
const [theme, setTheme] = React.useState(getServerSideTheme)
const [theme, setTheme] = React.useState(getInitialTheme)
const rawSetTheme = theme => {
const root = window.document.documentElement