diff --git a/src/App.js b/src/App.js
index d32c6c1..59769dd 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,22 +1,43 @@
-import React, {useState} from "react";
-import {Bluelib} from "bluelib/lib/components";
-import {Router} from "@reach/router";
+import React, {Fragment, useState} from "react";
+import {BaseLink, Bluelib, Main} from "bluelib/lib/components";
+import {Router, } from "@reach/router";
import Home from "./routes/Home";
import Error404 from "./routes/Error404";
import Gestinfo from "./routes/Gestinfo";
import style from "./App.module.css";
+import MainTitle from "./components/MainTitle";
+import ContextSetSubtitle from "./contexts/ContextSetSubtitle";
+import Footer from "./components/Footer";
+
export default function App() {
const [skin, setSkin] = useState("rygblue");
+ const [subtitle, setSubtitle] = useState(null);
return (
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
}
diff --git a/src/components/Page.js b/src/components/Page.js
deleted file mode 100644
index 8b66bda..0000000
--- a/src/components/Page.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import React from "react";
-import {Main} from "bluelib/lib/components";
-import MainTitle from "./MainTitle";
-import PropTypes from "prop-types";
-import Footer from "./Footer";
-
-
-export default function Page({children, subtitle}) {
- return (
-
-
-
- {children}
-
-
-
- )
-}
-
-
-Page.propTypes = {
- children: PropTypes.node,
- subtitle: PropTypes.node,
-}
\ No newline at end of file
diff --git a/src/components/SelectSkin.js b/src/components/SelectSkin.js
new file mode 100644
index 0000000..959d39f
--- /dev/null
+++ b/src/components/SelectSkin.js
@@ -0,0 +1,14 @@
+import React, {useContext} from "react";
+import ContextBluelibSkin from "bluelib/lib/contexts/ContextBluelibSkin";
+
+
+export default function SelectSkin({skin, setSkin}) {
+ return (
+
+
+
+ );
+}
diff --git a/src/contexts/ContextSetSubtitle.js b/src/contexts/ContextSetSubtitle.js
new file mode 100644
index 0000000..f17c5e4
--- /dev/null
+++ b/src/contexts/ContextSetSubtitle.js
@@ -0,0 +1,9 @@
+import {createContext} from "react";
+
+
+function defaultSetter() {
+ throw new Error("No subtitle setter found.")
+}
+
+
+export default createContext(defaultSetter);
diff --git a/src/hooks/useSubtitle.js b/src/hooks/useSubtitle.js
new file mode 100644
index 0000000..be6b83d
--- /dev/null
+++ b/src/hooks/useSubtitle.js
@@ -0,0 +1,11 @@
+import React, {useContext, useEffect} from "react";
+import ContextSetSubtitle from "../contexts/ContextSetSubtitle";
+
+
+export default function useSubtitle(node) {
+ const setSubtitle = useContext(ContextSetSubtitle);
+
+ useEffect(() => {
+ setSubtitle(node);
+ }, [])
+}
diff --git a/src/routes/Error404.js b/src/routes/Error404.js
index c351591..0b27ec6 100644
--- a/src/routes/Error404.js
+++ b/src/routes/Error404.js
@@ -1,23 +1,19 @@
import React from "react";
-import {Paragraph, Box, Title, Color, BaseLink} from "bluelib/lib/components";
-import Page from "../components/Page";
+import {Paragraph, Color} from "bluelib/lib/components";
import TitleBox from "../components/TitleBox";
-import TitleSplit from "../components/TitleSplit";
+import useSubtitle from "../hooks/useSubtitle";
export default function Error404() {
+ useSubtitle(Errore 404);
+
return (
-
- Non trovato}>
- 404}>
-
- Mi spiace, ma la pagina che hai richiesto non sembra esistere :(
-
-
- ← Torna alla home
-
-
-
-
+
+ Pagina non trovata}>
+
+ Mi spiace, ma la pagina che hai richiesto non sembra esistere :(
+
+
+
)
}
diff --git a/src/routes/Gestinfo/index.js b/src/routes/Gestinfo/index.js
index 80be9ef..63c163d 100644
--- a/src/routes/Gestinfo/index.js
+++ b/src/routes/Gestinfo/index.js
@@ -1,7 +1,6 @@
import React from "react";
import {Split, Aside, Anchor, Help, Blockquote, Title, Separator, Code, Color, Underline as U, BaseLink as A, Paragraph as P, Bold as B, Italic as I, ListItem as LI, Table} from "bluelib/lib/components";
import LatexMath from "bluelib/lib/components/LatexMath";
-import Page from "../../components/Page";
import TitleSplit from "../../components/TitleSplit";
import TitleBox from "../../components/TitleBox";
import IR from "./abbr/IR";
@@ -12,19 +11,20 @@ import Ononimi from "./abbr/Ononimi";
import UIN from "./abbr/UIN";
import Regex from "./abbr/Regex";
import Glob from "./abbr/Glob";
-import PlusLI from "../../components/PlusLI";
-import MinusLI from "../../components/MinusLI";
import Predicato from "./abbr/Predicato";
import Todo from "../../components/Todo";
import IDF from "./abbr/IDF";
import TF from "./abbr/TF";
import TFIDF from "./abbr/TFIDF";
import RSV from "./abbr/RSV";
+import useSubtitle from "../../hooks/useSubtitle";
export default function Gestinfo() {
+ useSubtitle("Gestione dell'informazione");
+
return (
-
+
@@ -892,6 +892,6 @@ export default function Gestinfo() {
-
+
)
}
diff --git a/src/routes/Home.js b/src/routes/Home.js
index 7b2a8de..846097f 100644
--- a/src/routes/Home.js
+++ b/src/routes/Home.js
@@ -1,14 +1,16 @@
import React from "react";
import {Split, Size, Color, Anchor, BaseLink as A, Paragraph as P, Bold as B, Italic as I, ListItem as LI} from "bluelib/lib/components";
-import Page from "../components/Page";
import TitleSplit from "../components/TitleSplit";
import TitleBox from "../components/TitleBox";
-import Todo from "../components/Todo";
+import useSubtitle from "../hooks/useSubtitle";
+import SelectSkin from "../components/SelectSkin";
-export default function Home() {
+export default function Home({skin, setSkin}) {
+ useSubtitle(Appunti open source di Steffo);
+
return (
- Appunti open source di Steffo}>
+
@@ -17,27 +19,35 @@ export default function Home() {
Se trovi un errore negli appunti, o un bug del sito, per favore segnalamelo su GitHub!
+
+
- Molte pagine non sono disponibili in quanto il sito è in fase di rinnovo.
+ Se i colori ti deconcentrano, non ti piacciono, o vuoi stampare alcune di queste pagine, puoi cambiare tema del sito qui:
+