1
Fork 0
mirror of https://github.com/Steffo99/unisteffo.git synced 2024-11-24 08:54:21 +00:00
triennale-appunti-steffo/pages/_app.tsx

52 lines
2 KiB
TypeScript
Raw Normal View History

2022-02-02 04:36:02 +00:00
import "../styles/global.css"
import type { AppProps } from 'next/app'
2022-02-04 01:14:51 +00:00
import { Link } from "../components/link"
2022-02-07 10:39:30 +00:00
import {Bluelib, Heading, LayoutThreeCol, Anchor as A, Footer, useBluelib} from "@steffo/bluelib-react"
2022-02-07 10:17:14 +00:00
import { useState, useEffect, useRef } from "react"
2022-02-04 05:16:29 +00:00
import { BluelibTheme } from "@steffo/bluelib-react/dist/types"
import { Theme } from "../components/theme-switcher"
2022-02-02 04:36:02 +00:00
function MyApp({ Component, pageProps }: AppProps) {
2022-02-04 05:16:29 +00:00
const [theme, setTheme] = useState<BluelibTheme>("sophon")
2022-02-07 10:39:30 +00:00
const ref = useRef<HTMLBodyElement | null>(null)
useEffect(
() => {
ref.current = document.body as HTMLBodyElement
},
[ref]
)
useBluelib(ref, {
theme,
})
2022-02-07 10:17:14 +00:00
2022-02-02 04:36:02 +00:00
return (
2022-02-04 05:16:29 +00:00
<Theme.Provider value={[theme, setTheme]}>
2022-02-07 10:17:14 +00:00
<LayoutThreeCol>
<LayoutThreeCol.Center>
<Heading level={1}>
<Link href="/">
Unisteffo
</Link>
</Heading>
<Component {...pageProps} />
<Footer>
<p>
2022-06-28 17:17:16 +00:00
© {new Date().getFullYear()} <A href="https://steffo.eu/">Stefano Pigozzi</A> - Tutto il contenuto del sito è reso disponibile con la licenza <A href="https://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA 4.0</A>.
2022-02-07 10:17:14 +00:00
</p>
<p>
Sito web <A href="https://github.com/Steffo99/appuntiweb-omega">open source</A> basato su <A href="https://github.com/Steffo99/bluelib">Bluelib</A> e <A href="https://github.com/Steffo99/bluelib-react">Bluelib React</A>
</p>
<p>
Se il contenuto di questo sito ti è utile, <A href="https://ko-fi.com/steffo">offrimi un caffè</A>!
</p>
</Footer>
</LayoutThreeCol.Center>
</LayoutThreeCol>
2022-02-04 05:16:29 +00:00
</Theme.Provider>
2022-02-02 04:36:02 +00:00
)
}
export default MyApp