1
Fork 0
mirror of https://github.com/Steffo99/unisteffo.git synced 2024-11-24 17:04:20 +00:00

Finish fr

This commit is contained in:
Steffo 2022-02-04 06:16:29 +01:00
parent 58a6aa4568
commit 2fb8610e64
4 changed files with 89 additions and 23 deletions

View 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>
)
}

View file

@ -2,10 +2,16 @@ 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">
<Theme.Provider value={[theme, setTheme]}>
<Bluelib theme={theme} id="root">
<LayoutThreeCol>
<LayoutThreeCol.Center>
<Heading level={1}>
@ -28,6 +34,7 @@ function MyApp({ Component, pageProps }: AppProps) {
</p>
</Footer>
</Bluelib>
</Theme.Provider>
)
}

View file

@ -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>
</>
}

View file

@ -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>