1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-06-30 01:26:37 -04:00

move some non-post pages to mdx

This commit is contained in:
2025-03-07 11:53:23 -05:00
parent 8118b8501a
commit 354dade9aa
72 changed files with 811 additions and 1873 deletions

View File

@ -1,8 +1,7 @@
"use client";
import { createContext, useCallback, useEffect, useState } from "react";
import useLocalStorage from "../hooks/useLocalStorage";
import useMedia from "../hooks/useMedia";
import { useLocalStorage, useMediaQuery } from "../hooks";
import type { Context, PropsWithChildren } from "react";
type Themes = "light" | "dark";
@ -29,7 +28,7 @@ export const ThemeProvider = ({ children }: PropsWithChildren) => {
const [systemTheme, setSystemTheme] = useState<Themes>("" as Themes);
// hook into system `prefers-dark-mode` setting
// https://web.dev/prefers-color-scheme/#the-prefers-color-scheme-media-query
const isSystemDark = useMedia("(prefers-color-scheme: dark)");
const isSystemDark = useMediaQuery("(prefers-color-scheme: dark)");
// updates the DOM and optionally saves the new theme to local storage
const applyTheme = useCallback(