mirror of
https://github.com/Steffo99/unisteffo.git
synced 2024-11-21 15:34:21 +00:00
Finish fr
This commit is contained in:
parent
58a6aa4568
commit
2fb8610e64
4 changed files with 89 additions and 23 deletions
20
components/theme-switcher.tsx
Normal file
20
components/theme-switcher.tsx
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { Form } from "@steffo/bluelib-react";
|
||||
import { createContext, useContext } from "react";
|
||||
|
||||
export const Theme: any = createContext(["sophon", () => console.error("Setting theme outside of context")])
|
||||
|
||||
export const ThemeSwitcher = () => {
|
||||
const [theme, setTheme] = useContext(Theme)
|
||||
|
||||
return (
|
||||
<Form>
|
||||
<Form.Select label="Tema" value={theme} onSimpleChange={setTheme} options={{
|
||||
"Royal Blue": "royalblue",
|
||||
"The Sophonity": "sophon",
|
||||
"Sheet of Paper": "paper",
|
||||
"Hacker Terminal": "hacker",
|
||||
"Gestione Amber": "amber",
|
||||
}}/>
|
||||
</Form>
|
||||
)
|
||||
}
|
|
@ -2,32 +2,39 @@ import "../styles/global.css"
|
|||
import type { AppProps } from 'next/app'
|
||||
import { Link } from "../components/link"
|
||||
import {Bluelib, Heading, LayoutThreeCol, Anchor as A, Footer} from "@steffo/bluelib-react"
|
||||
import { useState } from "react"
|
||||
import { BluelibTheme } from "@steffo/bluelib-react/dist/types"
|
||||
import { Theme } from "../components/theme-switcher"
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
const [theme, setTheme] = useState<BluelibTheme>("sophon")
|
||||
|
||||
return (
|
||||
<Bluelib theme="sophon" id="root">
|
||||
<LayoutThreeCol>
|
||||
<LayoutThreeCol.Center>
|
||||
<Heading level={1}>
|
||||
<Link href="/">
|
||||
Unisteffo
|
||||
</Link>
|
||||
</Heading>
|
||||
<Component {...pageProps} />
|
||||
</LayoutThreeCol.Center>
|
||||
</LayoutThreeCol>
|
||||
<Footer>
|
||||
<p>
|
||||
© {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/3.0/it/">CC-BY-SA 3.0 IT</A>.
|
||||
</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>
|
||||
</Bluelib>
|
||||
<Theme.Provider value={[theme, setTheme]}>
|
||||
<Bluelib theme={theme} id="root">
|
||||
<LayoutThreeCol>
|
||||
<LayoutThreeCol.Center>
|
||||
<Heading level={1}>
|
||||
<Link href="/">
|
||||
Unisteffo
|
||||
</Link>
|
||||
</Heading>
|
||||
<Component {...pageProps} />
|
||||
</LayoutThreeCol.Center>
|
||||
</LayoutThreeCol>
|
||||
<Footer>
|
||||
<p>
|
||||
© {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/3.0/it/">CC-BY-SA 3.0 IT</A>.
|
||||
</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>
|
||||
</Bluelib>
|
||||
</Theme.Provider>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Heading, Chapter, Box, Idiomatic as I, Anchor as A, ListUnordered, ListOrdered } from '@steffo/bluelib-react'
|
||||
import type { NextPage } from 'next'
|
||||
import { Link } from "../components/link"
|
||||
import { ThemeSwitcher } from '../components/theme-switcher'
|
||||
|
||||
|
||||
const Home: NextPage = () => {
|
||||
|
@ -155,6 +156,42 @@ const Home: NextPage = () => {
|
|||
</ListUnordered>
|
||||
</Box>
|
||||
</Chapter>
|
||||
<Chapter>
|
||||
<Box>
|
||||
<Heading level={3}>
|
||||
Amici e colleghi
|
||||
</Heading>
|
||||
<ListUnordered>
|
||||
<ListUnordered.Item>
|
||||
<Link href="https://navigator.erre2.fermitech.info/erre2/erre2.fermitech.info/">
|
||||
Erre2 (Modena)
|
||||
</Link>
|
||||
</ListUnordered.Item>
|
||||
<ListUnordered.Item>
|
||||
<Link href="https://navigator.erre2.fermitech.info/erre2/erre2next.fermitech.info/">
|
||||
Erre2 Next (Bologna)
|
||||
</Link>
|
||||
</ListUnordered.Item>
|
||||
<ListUnordered.Item>
|
||||
<Link href="https://github.com/topics/unimore-informatica">
|
||||
[unimore-informatica] su GitHub
|
||||
</Link>
|
||||
</ListUnordered.Item>
|
||||
<ListUnordered.Item>
|
||||
<Link href="https://thor.steffo.eu/">
|
||||
Unimore Informatica Telegram
|
||||
</Link>
|
||||
</ListUnordered.Item>
|
||||
</ListUnordered>
|
||||
|
||||
</Box>
|
||||
<Box>
|
||||
<Heading level={3}>
|
||||
Cambia tema
|
||||
</Heading>
|
||||
<ThemeSwitcher/>
|
||||
</Box>
|
||||
</Chapter>
|
||||
</>
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@ const Page: NextPage = () => {
|
|||
<ListUnordered>
|
||||
<ListUnordered.Item>
|
||||
<Link href="https://gist.github.com/Steffo99/e6a8271f193303f40ddac4df2a366383">Tris in Prolog</Link>
|
||||
</ListUnordered.Item>
|
||||
<ListUnordered.Item>
|
||||
<Link href="https://gist.github.com/Steffo99/426018f91fd24d93fab610df5366facc">Lunghezza di una lista in Prolog</Link>
|
||||
</ListUnordered.Item>
|
||||
</ListUnordered>
|
||||
|
|
Loading…
Reference in a new issue