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.
10 lines
353 B
10 lines
353 B
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" |
|
}
|
|
|