From 9bfad134cb8e17f1da5b826b845fc65cf18e046a Mon Sep 17 00:00:00 2001 From: abiyasa05 Date: Mon, 18 Nov 2024 15:37:58 +0700 Subject: [PATCH] update: add scroll area using shadcn for left side bar --- .../assessment/index.lazy.tsx | 186 +++++++++--------- .../_verifyingLayout/verifying/index.lazy.tsx | 184 ++++++++--------- 2 files changed, 189 insertions(+), 181 deletions(-) diff --git a/apps/frontend/src/routes/_assessmentLayout/assessment/index.lazy.tsx b/apps/frontend/src/routes/_assessmentLayout/assessment/index.lazy.tsx index 0b2c302..b6d2a33 100644 --- a/apps/frontend/src/routes/_assessmentLayout/assessment/index.lazy.tsx +++ b/apps/frontend/src/routes/_assessmentLayout/assessment/index.lazy.tsx @@ -626,108 +626,112 @@ export default function AssessmentPage() { {isMobile && ( setIsLeftSidebarOpen(open)}> - -
-
- {/* Aspek */} - {aspectsQuery.data?.data - .filter((aspect) => - aspect.subAspects.some((subAspect) => - data?.data.some((question) => question.subAspectId === subAspect.id) + + +
+
+ {/* Aspek */} + {aspectsQuery.data?.data + .filter((aspect) => + aspect.subAspects.some((subAspect) => + data?.data.some((question) => question.subAspectId === subAspect.id) + ) ) - ) - .map((aspect) => ( -
-
toggleAspect(aspect.id)} - > -
{aspect.name}
-
- {openAspects[aspect.id] ? ( - - ) : ( - - )} + .map((aspect) => ( +
+
toggleAspect(aspect.id)} + > +
{aspect.name}
+
+ {openAspects[aspect.id] ? ( + + ) : ( + + )} +
-
- {/* Sub-Aspek */} - {openAspects[aspect.id] && ( -
- {aspect.subAspects - .filter((subAspect) => - data?.data.some((question) => question.subAspectId === subAspect.id) - ) - .map((subAspect) => ( -
setSelectedSubAspectId(subAspect.id)} - > -
{subAspect.name}
-
- ))} -
- )} -
- ))} + {/* Sub-Aspek */} + {openAspects[aspect.id] && ( +
+ {aspect.subAspects + .filter((subAspect) => + data?.data.some((question) => question.subAspectId === subAspect.id) + ) + .map((subAspect) => ( +
setSelectedSubAspectId(subAspect.id)} + > +
{subAspect.name}
+
+ ))} +
+ )} +
+ ))} +
-
+
)} {/* Sidebar for Desktop (Always Visible) */} -
- -
-
- {/* Aspek */} - {aspectsQuery.data?.data - .filter((aspect) => - aspect.subAspects.some((subAspect) => - data?.data.some((question) => question.subAspectId === subAspect.id) +
+ + +
+
+ {/* Aspek */} + {aspectsQuery.data?.data + .filter((aspect) => + aspect.subAspects.some((subAspect) => + data?.data.some((question) => question.subAspectId === subAspect.id) + ) ) - ) - .map((aspect) => ( -
-
toggleAspect(aspect.id)} - > -
{aspect.name}
-
- {openAspects[aspect.id] ? ( - - ) : ( - - )} + .map((aspect) => ( +
+
toggleAspect(aspect.id)} + > +
{aspect.name}
+
+ {openAspects[aspect.id] ? ( + + ) : ( + + )} +
-
- {/* Sub-Aspek */} - {openAspects[aspect.id] && ( -
- {aspect.subAspects - .filter((subAspect) => - data?.data.some((question) => question.subAspectId === subAspect.id) - ) - .map((subAspect) => ( -
setSelectedSubAspectId(subAspect.id)} - > -
{subAspect.name}
-
- ))} -
- )} -
- ))} + {/* Sub-Aspek */} + {openAspects[aspect.id] && ( +
+ {aspect.subAspects + .filter((subAspect) => + data?.data.some((question) => question.subAspectId === subAspect.id) + ) + .map((subAspect) => ( +
setSelectedSubAspectId(subAspect.id)} + > +
{subAspect.name}
+
+ ))} +
+ )} +
+ ))} +
-
+
{/* MIDDLE */} @@ -755,10 +759,10 @@ export default function AssessmentPage() { >
{/* Question Number */} - + {/* Question Text */} - + {/* Action Button/Flag */}