diff --git a/src/components/Tasks/QuickAdd.tsx b/src/components/Tasks/QuickAdd.tsx index b663198..90ea832 100644 --- a/src/components/Tasks/QuickAdd.tsx +++ b/src/components/Tasks/QuickAdd.tsx @@ -14,13 +14,14 @@ import TextField from '@material-ui/core/TextField'; import { TaskType, PimType, TaskStatusType } from '../../pim-types'; interface PropsType { + style: React.CSSProperties; onSubmit: (item: PimType, journalUid: string, originalItem?: PimType) => void; defaultCollection: EteSync.CollectionInfo; } function QuickAdd(props: PropsType) { const [title, setTitle] = React.useState(''); - const { onSubmit: save, defaultCollection } = props; + const { style, onSubmit: save, defaultCollection } = props; function handleChange(e: React.ChangeEvent) { @@ -43,7 +44,7 @@ function QuickAdd(props: PropsType) { return ( -
+ -
- {props.collections && } - - setShowCompleted(!showCompleted)} /> - } - label="Show Completed" - /> -
+ diff --git a/src/components/Tasks/Toolbar.tsx b/src/components/Tasks/Toolbar.tsx new file mode 100644 index 0000000..26c5c16 --- /dev/null +++ b/src/components/Tasks/Toolbar.tsx @@ -0,0 +1,68 @@ +import * as React from 'react'; + +import * as EteSync from 'etesync'; + +import Switch from '@material-ui/core/Switch'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import IconButton from '@material-ui/core/IconButton'; +import MoreVertIcon from '@material-ui/icons/MoreVert'; +import Menu from '@material-ui/core/Menu'; +import MenuItem from '@material-ui/core/MenuItem'; + +import QuickAdd from './QuickAdd'; + +import { PimType } from '../../pim-types'; + +interface PropsType { + defaultCollection: EteSync.CollectionInfo; + onItemSave: (item: PimType, journalUid: string, originalItem?: PimType) => Promise; + showCompleted: boolean; + setShowCompleted: (completed: boolean) => void; +} + +export default function Toolbar(props: PropsType) { + const { defaultCollection, onItemSave, showCompleted, setShowCompleted } = props; + + const [anchorEl, setAnchorEl] = React.useState(null); + + const handleClick = (event: React.MouseEvent) => { + setAnchorEl(event.currentTarget); + }; + + const handleClose = () => { + setAnchorEl(null); + }; + + return ( +
+ {defaultCollection && } + +
+ + + + + + setShowCompleted(checked)} />} + /> + + + +
+
+ ); +} \ No newline at end of file