rename config context to menu context; move config to state

This commit is contained in:
tmshv committed 2025-08-25 23:56:35 +03:00
1 parent 20c59affd7
commit 945947aa22
8 files changed
+45 -36

No files matched your search

+8 -5
View File
@@ -1,10 +1,13 @@
import { useContext } from "react"
import { ConfigContext } from "src/context/ConfigContext"
import { state } from "@/store/config"
import { useSnapshot } from "valtio"
export const Copyright: React.FC = () => {
const { yearStart, yearEnd } = useContext(ConfigContext)
function Copyright() {
const { years } = useSnapshot(state)
const year = years.map(String).join("—")
return (
<span>©&nbsp;{yearStart}—{yearEnd} Шлиссельбургская детская художественная школа</span>
<span>©&nbsp;{year} Шлиссельбургская детская художественная школа</span>
)
}
export default Copyright