|
|
@ -127,8 +127,6 @@ const WorkWeekView = ({ events }) => {
|
|
|
|
const WorkWeekVerticalView = ({ events, selection, setSelection, hideOtherCourses }) => {
|
|
|
|
const WorkWeekVerticalView = ({ events, selection, setSelection, hideOtherCourses }) => {
|
|
|
|
const selectionSet = new Set(selection)
|
|
|
|
const selectionSet = new Set(selection)
|
|
|
|
|
|
|
|
|
|
|
|
console.log(hideOtherCourses)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const eventsByWeekday = _.groupBy(
|
|
|
|
const eventsByWeekday = _.groupBy(
|
|
|
|
!hideOtherCourses ? events : events.filter(e => selectionSet.has(e.name)),
|
|
|
|
!hideOtherCourses ? events : events.filter(e => selectionSet.has(e.name)),
|
|
|
|
event => event.start.getDay()
|
|
|
|
event => event.start.getDay()
|
|
|
@ -273,10 +271,14 @@ const WorkWeekVerticalView = ({ events, selection, setSelection, hideOtherCourse
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const CourseView = ({ events, selection, setSelection }) => {
|
|
|
|
const CourseView = ({ events, selection, setSelection, hideOtherCourses }) => {
|
|
|
|
const eventsByCourse = _.groupBy(events, 'name')
|
|
|
|
|
|
|
|
const selectionSet = new Set(selection)
|
|
|
|
const selectionSet = new Set(selection)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const eventsByCourse = _.groupBy(
|
|
|
|
|
|
|
|
!hideOtherCourses ? events : events.filter(e => selectionSet.has(e.name)),
|
|
|
|
|
|
|
|
'name'
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const [currentlyHovered, setCurrentlyHovered] = useState(null)
|
|
|
|
const [currentlyHovered, setCurrentlyHovered] = useState(null)
|
|
|
|
const element = useRef()
|
|
|
|
const element = useRef()
|
|
|
|
|
|
|
|
|
|
|
@ -312,7 +314,7 @@ const CourseView = ({ events, selection, setSelection }) => {
|
|
|
|
data-course-id={name}
|
|
|
|
data-course-id={name}
|
|
|
|
onClick={() => {
|
|
|
|
onClick={() => {
|
|
|
|
if (!selectionSet.has(name)) setSelection([...selection, name])
|
|
|
|
if (!selectionSet.has(name)) setSelection([...selection, name])
|
|
|
|
else setSelection(selection.filter(name => name !== name))
|
|
|
|
else setSelection(selection.filter(n => n !== name))
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="title">
|
|
|
|
<div class="title">
|
|
|
@ -351,11 +353,9 @@ const viewModeMap = {
|
|
|
|
export const EventsView = ({ mode, ...viewProps }) => {
|
|
|
|
export const EventsView = ({ mode, ...viewProps }) => {
|
|
|
|
const Mode = viewModeMap[mode]
|
|
|
|
const Mode = viewModeMap[mode]
|
|
|
|
|
|
|
|
|
|
|
|
const [selectedCourses, setSelectedCourses] = useState([])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div class="events-view">
|
|
|
|
<div class="events-view">
|
|
|
|
<Mode selection={selectedCourses} setSelection={setSelectedCourses} {...viewProps} />
|
|
|
|
<Mode {...viewProps} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|