diff --git a/src/components/CourseVisibility.jsx b/src/components/CourseVisibility.jsx new file mode 100644 index 0000000..a64ec18 --- /dev/null +++ b/src/components/CourseVisibility.jsx @@ -0,0 +1,12 @@ +import { Icon } from './Icon.jsx' + +export const ToolOverlay = ({ visibility, toggleVisibility }) => ( +
+) diff --git a/src/components/EventsView.jsx b/src/components/EventsView.jsx index 34b1bf5..f836eb4 100644 --- a/src/components/EventsView.jsx +++ b/src/components/EventsView.jsx @@ -124,8 +124,15 @@ const WorkWeekView = ({ events }) => { ) } -const WorkWeekVerticalView = ({ events }) => { - const eventsByWeekday = _.groupBy(events, event => event.start.getDay()) +const WorkWeekVerticalView = ({ events, selection, setSelection, hideOtherCourses }) => { + const selectionSet = new Set(selection) + + console.log(hideOtherCourses) + + const eventsByWeekday = _.groupBy( + !hideOtherCourses ? events : events.filter(e => selectionSet.has(e.name)), + event => event.start.getDay() + ) const dayIntervalLayout = _.mapValues(eventsByWeekday, events => layoutIntervals( @@ -216,7 +223,8 @@ const WorkWeekVerticalView = ({ events }) => { 'event' + (currentlyHovered === event.data.name ? ' highlight' - : '') + : '') + + (selectionSet.has(event.data.name) ? ' selected' : '') } data-event-id={event.data.name} style={{ @@ -228,6 +236,16 @@ const WorkWeekVerticalView = ({ events }) => { 360) + 'deg', }} + onClick={() => { + if (!selectionSet.has(event.data.name)) + setSelection([...selection, event.data.name]) + else + setSelection( + selection.filter( + name => event.data.name !== name + ) + ) + }} >