Project initial

This commit is contained in:
chengpu
2022-12-03 00:54:53 +08:00
commit 5092a5e717
502 changed files with 50820 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import {useState} from 'react'
function getTheme() {
const isDarkConfig =
window.matchMedia &&
window.matchMedia('(prefers-color-scheme: dark)').matches
const theme = localStorage.getItem('springtheme')
if (!theme) {
return isDarkConfig ? 'dark' : 'light'
}
return theme
}
export default function useTheme() {
const [darkTheme] = useState(getTheme())
return darkTheme
}