diff --git a/.nvmrc b/.nvmrc index e44a38e..67e145b 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.12.1 +v20.18.0 diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 1544c3d..e506233 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -65,11 +65,43 @@ const IndexPage = ({ data }) => { -
+
-

- Timeline organizzativa +

+ Condividi i momenti migliori

+
+

+ Segui l'evento sul social network libero Mastodon (accessibile + da qualsiasi piattaforma federata ActivityPub):{" "} + + @unixmib@mastodon.uno + + ,
+ puoi seguicrci anche su social tradizionali come:{" "} + @unixMiB su Twitter{" "} + (#LinuxDayMilano2024){" e "} + + @unixmib su Facebook + + . +

+

+ Oppure iscriviti al nostro{" "} + canale telegram per + rimanere aggiornato anche sui nostri eventi futuri. +

+

+ Usa l'hashtag ufficiale #LinuxDay2024 e le foto migliori saranno + ricondivise! +

+
+
+
+ +
+ +

Timeline organizzativa

  1. lunedì 20 giugno - Apertura call for papers
  2. @@ -83,7 +115,7 @@ const IndexPage = ({ data }) => {
-
+
diff --git a/src/pages/schedule-printable.jsx b/src/pages/schedule-printable.jsx new file mode 100644 index 0000000..68fde6e --- /dev/null +++ b/src/pages/schedule-printable.jsx @@ -0,0 +1,425 @@ +import React, { useState, useEffect } from "react"; +import { graphql, navigate } from "gatsby"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import Button from "react-bootstrap/Button"; +import Container from "react-bootstrap/Container"; +import Row from "react-bootstrap/Row"; +import Col from "react-bootstrap/Col"; +import Modal from "react-bootstrap/Modal"; +import Dropdown from "react-bootstrap/Dropdown"; +import Seo from "../components/seo"; +import Header from "../components/header"; +import { icon } from "@fortawesome/fontawesome-svg-core/import.macro"; + +const Talks = ({ + scheduleData, + showStarred, + starredTalksForYear, + toggleTalkStar, + showDescriptions, +}) => { + const [data, setData] = useState(scheduleData); + const [modalData, setModalData] = useState({ + show: false, + title: "Titolo", + description: "Descrizione", + author: "Autore", + room: "Aula", + duration: "Durata", + slides: "", + video: "", + }); + + const replaceModalItem = (item) => { + setModalData((current) => ({ + ...item, + show: !current.show, + })); + }; + + const handleStarClick = (title, clickEvent) => { + clickEvent.stopPropagation(); + toggleTalkStar(title); + }; + + const StarToggle = ({ title }) => ( + handleStarClick(title, e)} + /> + ); + + return ( + <> + { + setModalData((current) => ({ + ...current, + show: false, + })); + }} + size='lg' + aria-labelledby='contained-modal-title-vcenter' + centered + > + + + {modalData.title} + + + +

{modalData.description}

+
+
{modalData.author}
+ + {modalData.duration && "Durata: " + modalData.duration} + + {modalData.room && "Aula: " + modalData.room} + + +
+ + +
+ +
+
+ {!(modalData.video === "" || modalData.video === null) && ( + + )} + {!(modalData.slides === "" || modalData.slides === null) && ( + + )} + +
+
+
+ {data.map((i, k) => { + return ( + + +
{i.time}
+ + {i.talks.map((t, u) => { + if ("development" === activeEnv) console.log(showStarred); + return !showStarred || starredTalksForYear?.includes(t.title) ? ( + +
+ + +
{t.title}
+ +
+ + +
{t.author}
+ +
+ {showDescriptions && ( + + +
{t.description}
+ +
+ )} + + + + {t.duration} + + + {t.room} + + + + + +
+ + ) : undefined; + })} +
+ ); + })} + + ); +}; + +const activeEnv = + process.env.GATSBY_ACTIVE_ENV || process.env.NODE_ENV || "development"; + +const Page = ({ data }) => { + const allSchedules = data.allSchedulesYaml.nodes; + const [showDescriptions, setShowDescriptions] = useState(false); + const [schedData, setSchedData] = useState(allSchedules[0]); + const [starredTalks, setStarredTalks] = useState({}); + const [showStarred, setShowStarred] = useState(false); + + const params = new URLSearchParams( + typeof window !== "undefined" && window.location.search + ); + const year = Number(params.get("year")); + + useEffect(() => { + let current = localStorage.getItem("starredTalks"); + if (current) { + try { + current = JSON.parse(current); + setStarredTalks(current); + } catch (e) { + console.error( + "localStorage.starredTalks was set, but can't be parsed as JSON" + ); + setStarredTalks({}); + } + } + localStorage.getItem("showStarred") === "true" && setShowStarred(true); + }, []); + + useEffect(() => { + if (year) { + allSchedules.forEach((i) => { + if (i.year === year) { + setSchedData(i); + } + }); + } + }, [year, allSchedules]); + + if ("development" === activeEnv) + console.log("schedData: " + JSON.stringify(schedData)); + + return ( +
+
+
+
+ +
+ +
+

+ Linux Day Milano {schedData?.year} -{" "} + {!showStarred ? "Programma della giornata" : "Agenda personale"} +

+ +
+ + + {data.site.siteMetadata.switches.year_switcher ? ( + + + Anno {schedData?.year} + + + {allSchedules.map((s, i) => ( + { + navigate( + typeof window !== "undefined" && + window.location.pathname + "?year=" + s.year + ); + setSchedData(allSchedules[i]); + }} + > + {s.year} + + ))} + + + ) : ( + + Anno {schedData?.year} + + )} +
+
+ + {schedData?.schedule.length ? ( + { + setStarredTalks((current) => { + let next; + + if (current[schedData?.year]?.includes(title)) { + next = { + ...current, + [schedData?.year]: current[schedData?.year].filter( + (t) => t !== title + ), + }; + } else { + next = { + ...current, + [schedData?.year]: [ + ...(current[schedData?.year] || []), + title, + ], + }; + } + + localStorage.setItem("starredTalks", JSON.stringify(next)); + + return next; + }); + }} + key={schedData?.schedule} + /> + ) : ( +
+ +

+ Ci sono eventi per questa giornata, sono solo in fase di + organizzazione. +

+

+ Puoi usare il selettore per leggere il programma degli anni + precedenti o ricontrolla tra qualche giorno! +

+
+ )} +
+
+
+ ); +}; + +export const query = graphql` + { + allSchedulesYaml(sort: { order: DESC, fields: year }) { + nodes { + year + schedule { + time + talks { + title + description + author + room + duration + slides + video + } + } + } + } + + site { + siteMetadata { + event { + year: date(formatString: "YYYY") + time + text: date(formatString: "dddd DD MMMM YYYY", locale: "It") + } + contacts { + email + website + } + switches { + schedule + cfp + year_switcher + } + } + } + } +`; + +export default Page; diff --git a/src/pages/schedule.jsx b/src/pages/schedule.jsx index f92aa07..8e37855 100644 --- a/src/pages/schedule.jsx +++ b/src/pages/schedule.jsx @@ -162,6 +162,8 @@ const Talks = ({ style={{ padding: "1rem", cursor: "pointer", + pageBreakInside: "avoid", + breakInside: "avoid", }} > @@ -247,7 +249,7 @@ const Page = ({ data }) => {
- +
@@ -256,6 +258,13 @@ const Page = ({ data }) => {
+