mirror of
https://github.com/Steffo99/unisteffo.git
synced 2024-11-21 23:44:22 +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,10 +2,16 @@ import "../styles/global.css"
|
||||||
import type { AppProps } from 'next/app'
|
import type { AppProps } from 'next/app'
|
||||||
import { Link } from "../components/link"
|
import { Link } from "../components/link"
|
||||||
import {Bluelib, Heading, LayoutThreeCol, Anchor as A, Footer} from "@steffo/bluelib-react"
|
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) {
|
function MyApp({ Component, pageProps }: AppProps) {
|
||||||
|
const [theme, setTheme] = useState<BluelibTheme>("sophon")
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Bluelib theme="sophon" id="root">
|
<Theme.Provider value={[theme, setTheme]}>
|
||||||
|
<Bluelib theme={theme} id="root">
|
||||||
<LayoutThreeCol>
|
<LayoutThreeCol>
|
||||||
<LayoutThreeCol.Center>
|
<LayoutThreeCol.Center>
|
||||||
<Heading level={1}>
|
<Heading level={1}>
|
||||||
|
@ -28,6 +34,7 @@ function MyApp({ Component, pageProps }: AppProps) {
|
||||||
</p>
|
</p>
|
||||||
</Footer>
|
</Footer>
|
||||||
</Bluelib>
|
</Bluelib>
|
||||||
|
</Theme.Provider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Heading, Chapter, Box, Idiomatic as I, Anchor as A, ListUnordered, ListOrdered } from '@steffo/bluelib-react'
|
import { Heading, Chapter, Box, Idiomatic as I, Anchor as A, ListUnordered, ListOrdered } from '@steffo/bluelib-react'
|
||||||
import type { NextPage } from 'next'
|
import type { NextPage } from 'next'
|
||||||
import { Link } from "../components/link"
|
import { Link } from "../components/link"
|
||||||
|
import { ThemeSwitcher } from '../components/theme-switcher'
|
||||||
|
|
||||||
|
|
||||||
const Home: NextPage = () => {
|
const Home: NextPage = () => {
|
||||||
|
@ -155,6 +156,42 @@ const Home: NextPage = () => {
|
||||||
</ListUnordered>
|
</ListUnordered>
|
||||||
</Box>
|
</Box>
|
||||||
</Chapter>
|
</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>
|
||||||
<ListUnordered.Item>
|
<ListUnordered.Item>
|
||||||
<Link href="https://gist.github.com/Steffo99/e6a8271f193303f40ddac4df2a366383">Tris in Prolog</Link>
|
<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>
|
<Link href="https://gist.github.com/Steffo99/426018f91fd24d93fab610df5366facc">Lunghezza di una lista in Prolog</Link>
|
||||||
</ListUnordered.Item>
|
</ListUnordered.Item>
|
||||||
</ListUnordered>
|
</ListUnordered>
|
||||||
|
|
Loading…
Reference in a new issue