From 502706eeeedef99901d0fd7139287d9997fba090 Mon Sep 17 00:00:00 2001 From: Maya Herrscher Date: Tue, 27 Sep 2022 14:22:11 +0200 Subject: [PATCH] Schedule display --- src/components/Schedule.tsx | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/components/Schedule.tsx diff --git a/src/components/Schedule.tsx b/src/components/Schedule.tsx new file mode 100644 index 0000000..f01a32e --- /dev/null +++ b/src/components/Schedule.tsx @@ -0,0 +1,36 @@ +import React, {useState } from 'react'; +import { Box, Button, Checkbox, Dialog, DialogActions, DialogContent, DialogTitle, Divider, List, ListItem, Switch, TextField, Tooltip, Typography } from '@mui/material'; +import { useLocalStorage } from '../hooks/useLocalStorage'; +import { Timeline, TimelineConnector, TimelineContent, TimelineDot, TimelineItem, TimelineSeparator, TimelineOppositeContent } from '@mui/lab'; + +/* + definition of events + events have IDs, names, a time (usually start-time) and can be variable in timing +*/ +type Eve = { + id: string, + name: string, + time: string, + var: boolean +} + +export function Schedule(){ + const [eve, setEve] = useState([{id: "2", name: "Testtermin 1425", time: "12:00", var: true},{id: "1", name: "Testtermin", time: "12:00", var: false},{id: "3", name: "Testtermin früh", time: "8:00", var:false}]) + return( +
+ Schedule + + {eve.map((e ,i) => + + {!e.var && {e.time}} + + + {((i+1) < eve.length) && } + + {e.name} + + )} + +
+) +}