rename config context to menu context; move config to state
This commit is contained in:
1 parent
20c59affd7
commit
945947aa22
8 files changed
+45
-36
No files matched your search
@@ -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>© {yearStart}—{yearEnd} Шлиссельбургская детская художественная школа</span>
|
||||
<span>© {year} Шлиссельбургская детская художественная школа</span>
|
||||
)
|
||||
}
|
||||
|
||||
export default Copyright
|
||||
Reference in new issue
Block a user