From 514843d04a1253f583612797a1947790c43717c3 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 7 Sep 2021 23:23:37 -0700 Subject: Add calendar menu --- modern/src/settings/CalendarsPage.js | 63 ++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 modern/src/settings/CalendarsPage.js (limited to 'modern/src/settings/CalendarsPage.js') diff --git a/modern/src/settings/CalendarsPage.js b/modern/src/settings/CalendarsPage.js new file mode 100644 index 00000000..076f30ca --- /dev/null +++ b/modern/src/settings/CalendarsPage.js @@ -0,0 +1,63 @@ +import React, { useState } from 'react'; +import { + TableContainer, Table, TableRow, TableCell, TableHead, TableBody, makeStyles, IconButton, +} from '@material-ui/core'; +import MoreVertIcon from '@material-ui/icons/MoreVert'; +import { useEffectAsync } from '../reactHelper'; +import EditCollectionView from '../EditCollectionView'; +import OptionsLayout from './OptionsLayout'; +import { useTranslation } from '../LocalizationProvider'; + +const useStyles = makeStyles((theme) => ({ + columnAction: { + width: theme.spacing(1), + padding: theme.spacing(0, 1), + }, +})); + +const CalendarsView = ({ updateTimestamp, onMenuClick }) => { + const classes = useStyles(); + const t = useTranslation(); + + const [items, setItems] = useState([]); + + useEffectAsync(async () => { + const response = await fetch('/api/calendars'); + if (response.ok) { + setItems(await response.json()); + } + }, [updateTimestamp]); + + return ( + + + + + + {t('sharedName')} + + + + {items.map((item) => ( + + + onMenuClick(event.currentTarget, item.id)}> + + + + {item.name} + + ))} + +
+
+ ); +}; + +const CalendarsPage = () => ( + + + +); + +export default CalendarsPage; -- cgit v1.2.3