From d03da57f26e4d8884deea5880e91fb4ca27a1162 Mon Sep 17 00:00:00 2001 From: Ulises Salinas Date: Tue, 15 Apr 2025 17:29:37 -0700 Subject: [PATCH] Design fix for options on different screen size --- .../course/[courseId]/start-session/page.tsx | 6 +- components/YAxisTick.tsx | 57 +++++++++++-------- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/app/dashboard/course/[courseId]/start-session/page.tsx b/app/dashboard/course/[courseId]/start-session/page.tsx index af4e7bf..9e38967 100644 --- a/app/dashboard/course/[courseId]/start-session/page.tsx +++ b/app/dashboard/course/[courseId]/start-session/page.tsx @@ -30,6 +30,7 @@ import { getQuestionsForSession, } from "@/services/session"; + export default function StartSession() { const params = useParams(); const router = useRouter(); @@ -183,6 +184,7 @@ export default function StartSession() { const activeQuestion = questions ? questions.find((q) => q.id === activeQuestionId) : null; const totalVotes = chartData.reduce((sum, item) => sum + item.Votes, 0); + return (
@@ -213,7 +215,7 @@ export default function StartSession() { data={chartData} layout="vertical" barCategoryGap={20} - margin={{ left: 100, right: 20, top: 20, bottom: 20 }} + margin={{ left: 100, right: 20, top: 0, bottom: 0 }} > } tickLine={false} axisLine={false} - tickMargin={8} + tickMargin={9} style={{ fill: "#000" }} /> maxChars ? fullText.slice(0, maxChars) + " . . . " : fullText; + const maxChars = 10; + const truncated = fullText.length > maxChars ? fullText.slice(0, maxChars) : fullText; return ( - + {truncated} {fullText.length > maxChars && ( - - - - - - -
- {fullText} -
-
-
+ +
+ + + + + +
+ {fullText} +
+
+
+
)}