From 171cbdac1109f390243ff9772588b69850443649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20G=C5=82owacki?= Date: Tue, 29 Dec 2020 17:32:06 +0100 Subject: [PATCH] updated with new api --- src/components/SchedulerRow.tsx | 8 ++++++-- src/contexts/CoursesProvider.tsx | 2 +- src/types/index.ts | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/SchedulerRow.tsx b/src/components/SchedulerRow.tsx index a0ad042..a007620 100644 --- a/src/components/SchedulerRow.tsx +++ b/src/components/SchedulerRow.tsx @@ -190,11 +190,15 @@ export const SchedulerRow = ({ groups, indexRow, rowTop, cellWidth, cellHeight } {groupsPerDay[group.day] < 3 ? (
{`${groups[index].time}-${groups[index].endTime}`}
-
3/{groups[index].capacity}
+
+ {groups[index].takenPlaces}/{groups[index].capacity} +
) : ( -
3/{groups[index].capacity}
+
+ {groups[index].takenPlaces}/{groups[index].capacity} +
)} diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index c7c9e91..6962fb7 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -210,7 +210,7 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { setCourses(sortedCourses); } catch (e) { console.log(e); - } + } }; useEffect(() => { diff --git a/src/types/index.ts b/src/types/index.ts index a6d8ade..fcf3b7c 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -19,6 +19,7 @@ export interface Group { room: string; type: GroupType; capacity?: number; + takenPlaces: number; } export interface Course { @@ -50,5 +51,6 @@ export interface SchedulerEvent { room: string; type: GroupType; capacity?: number; + takenPlaces: number; name: string; }