You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
353 B
11 lines
353 B
2 years ago
|
import { useContext } from "react"
|
||
|
import { ServerSidePropsContext } from "../contextProviders/serverSidePropsProvider"
|
||
|
import jsCookies from "js-cookie"
|
||
|
|
||
|
const COOKIE_NAME = "theme"
|
||
|
|
||
|
export const useCurrentTheme = () => {
|
||
|
const { cookies } = useContext(ServerSidePropsContext)
|
||
|
return jsCookies.get(COOKIE_NAME) || cookies[COOKIE_NAME] || "light"
|
||
|
}
|