From 86c010867261aa081b036f0b3e80b6b4642dd889 Mon Sep 17 00:00:00 2001 From: Alireza Date: Tue, 28 Nov 2023 23:56:03 +0330 Subject: [PATCH] fix: description for workshops and presentations --- frontend/src/pages/my-account/MyAccount.jsx | 3 ++- frontend/src/pages/workshops/WorkshopsPage.jsx | 3 ++- frontend/src/pages/workshops/useWorkshopsPage.js | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/my-account/MyAccount.jsx b/frontend/src/pages/my-account/MyAccount.jsx index 9fc7d49..480d0bf 100644 --- a/frontend/src/pages/my-account/MyAccount.jsx +++ b/frontend/src/pages/my-account/MyAccount.jsx @@ -67,7 +67,7 @@ const MyAccount = () => { isWorkshop={type === 'Workshops'} purchaseState={type === 'Cart' ? 1 : 2} title={item.name} - description={Helper.omitLongString(item.desc, 100)} + description={item.desc} level={item.level} startDate={item.start_date} endDate={item.end_date} @@ -77,6 +77,7 @@ const MyAccount = () => { prerequisites={item.prerequisites} syllabus={item.syllabus} capacity={item.capacity} + remainingCapacity={item.remaining_capacity} isFull={item.isFull} addToCalendarLink={item.addToCalendarLink} onClickAddToCart={() => {}} diff --git a/frontend/src/pages/workshops/WorkshopsPage.jsx b/frontend/src/pages/workshops/WorkshopsPage.jsx index 93b34f4..4146eb2 100644 --- a/frontend/src/pages/workshops/WorkshopsPage.jsx +++ b/frontend/src/pages/workshops/WorkshopsPage.jsx @@ -42,7 +42,8 @@ export default function WorkshopsPage() { key={index} isWorkshop={item.isWorkshop} title={item.name} - description={item.desc && Helper.omitLongString(item.desc, 50)} + description={item.desc} + remainingCapacity={item.remaining_capacity} purchaseState={0} presenterName={item.presenters.join(', ')} startDate={new Date(item.start_date).toLocaleString()} diff --git a/frontend/src/pages/workshops/useWorkshopsPage.js b/frontend/src/pages/workshops/useWorkshopsPage.js index 0953b97..5f02bb9 100644 --- a/frontend/src/pages/workshops/useWorkshopsPage.js +++ b/frontend/src/pages/workshops/useWorkshopsPage.js @@ -112,6 +112,7 @@ export default function useWorkshopsPage() { item['isWorkshop'] = !('presenters' in workshop); item['capacity'] = workshop.capacity; item['cost'] = workshop.cost; + item['remaining_capacity'] = workshop.remaining_capacity return item; }) .filter((e) => e != null);