Skip to content
Snippets Groups Projects
Verified Commit 65878b89 authored by Alex Reinhardt's avatar Alex Reinhardt
Browse files

Move 'Gremien'-Definition to Config

parent fafa198b
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,31 @@ ...@@ -41,7 +41,31 @@
"w": 16, "w": 16,
"h": 4 "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", "type": "callout",
......
...@@ -6,6 +6,7 @@ import QRCode from "react-qr-code"; ...@@ -6,6 +6,7 @@ import QRCode from "react-qr-code";
import { Clock, MapPin } from '@phosphor-icons/react' import { Clock, MapPin } from '@phosphor-icons/react'
export type GremiumPanelDefinition = { export type GremiumPanelDefinition = {
gremien: [Gremium]
} }
type Gremium = { type Gremium = {
...@@ -16,37 +17,13 @@ type Gremium = { ...@@ -16,37 +17,13 @@ type Gremium = {
location: string 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 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); const cycle = useRef<number>(0);
useEffect(() => { useEffect(() => {
const update = async () => { const update = async () => {
setGremium(gremien[cycle.current++ % gremien.length]); setGremium(props.definition.gremien[cycle.current++ % props.definition.gremien.length]);
console.log(gremium); console.log(gremium);
console.log(cycle.current); console.log(cycle.current);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment