diff --git a/public/config/default.json b/public/config/default.json index 30ebfad1706fc85e329896fa49d45b826e252bc1..6eea71170ea067368e3863ecd2a3f3ada1f9a743 100644 --- a/public/config/default.json +++ b/public/config/default.json @@ -41,7 +41,31 @@ "w": 16, "h": 4 }, - "config": {} + "config": { + "gremien": [ + { + "name": "FSR", + "description": "Fachschaftsrat", + "link": "https://oh14.de/fsr", + "time": "Mittwoch, 12:15 Uhr", + "location": "Chaos-Zentrum-Informatik (OH14 - E39)" + }, + { + "name": "FOSS-AG", + "description": "Free and Open Source Software - AG", + "link": "https://foss-ag.de/", + "time": "Montag, 18:00 Uhr", + "location": "Chaos-Zentrum-Informatik (OH14 - E39)" + }, + { + "name": "CyberSec-AG", + "description": "Cybersecurity - AG", + "link": "https://oh14.de/cybersec", + "time": "Donnerstag, 18:00 Uhr", + "location": "Chaos-Zentrum-Informatik (OH14 - E39)" + } + ] + } }, { "type": "callout", diff --git a/src/panels/Gremium/GremiumPanel.tsx b/src/panels/Gremium/GremiumPanel.tsx index 025fb66daabaf2b66ba89b36c1dd5d1b12344b16..265fe088a5b4d25ddf67275ffabb598e55b9b91c 100644 --- a/src/panels/Gremium/GremiumPanel.tsx +++ b/src/panels/Gremium/GremiumPanel.tsx @@ -6,6 +6,7 @@ import QRCode from "react-qr-code"; import { Clock, MapPin } from '@phosphor-icons/react' export type GremiumPanelDefinition = { + gremien: [Gremium] } type Gremium = { @@ -16,37 +17,13 @@ type Gremium = { location: string } -const gremien: Gremium[] = [ - { - name: "FSR", - description: "Fachschaftsrat", - link: "https://oh14.de/fsr", - time: "Mittwoch, 12:15 Uhr", - location: "Chaos-Zentrum-Informatik (OH14 - E39)" - }, - { - name: "FOSS-AG", - description: "Free and Open Source Software - AG", - link: "https://foss-ag.de/", - time: "Montag, 18:00 Uhr", - location: "Chaos-Zentrum-Informatik (OH14 - E39)" - }, - { - name: "CyberSec-AG", - description: "Cybersecurity - AG", - link: "https://oh14.de/cybersec", - time: "Donnerstag, 18:00 Uhr", - location: "Chaos-Zentrum-Informatik (OH14 - E39)" - } -] - const GremiumPanel = (props: {definition: GremiumPanelDefinition}) => { - const [gremium, setGremium] = useState<Gremium>(gremien[0]); + const [gremium, setGremium] = useState<Gremium>(props.definition.gremien[0]); const cycle = useRef<number>(0); useEffect(() => { const update = async () => { - setGremium(gremien[cycle.current++ % gremien.length]); + setGremium(props.definition.gremien[cycle.current++ % props.definition.gremien.length]); console.log(gremium); console.log(cycle.current); }