Spaces:
Sleeping
Sleeping
Update web/src/components/sidebar/LeftSidebar.tsx
Browse files
web/src/components/sidebar/LeftSidebar.tsx
CHANGED
|
@@ -170,6 +170,20 @@ export function LeftSidebar(props: Props) {
|
|
| 170 |
}, [spaceType, isMyWorkspace]);
|
| 171 |
|
| 172 |
// --------- CourseInfo resolution ---------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
const courseInfo = useMemo((): CourseDirectoryItem | null => {
|
| 174 |
const list = Array.isArray(availableCourses) ? availableCourses : [];
|
| 175 |
|
|
@@ -357,27 +371,29 @@ export function LeftSidebar(props: Props) {
|
|
| 357 |
</div>
|
| 358 |
|
| 359 |
{/* 1) Welcome ↔ Course divider */}
|
| 360 |
-
<
|
|
|
|
|
|
|
|
|
|
| 361 |
|
| 362 |
{/* Course + Group */}
|
| 363 |
<div className="px-4 pt-10 pb-10 space-y-4">
|
| 364 |
<div className="text-[30px] leading-tight font-semibold">{courseName}</div>
|
| 365 |
|
| 366 |
-
|
| 367 |
-
{/* ===== My Space
|
| 368 |
{!isTeamSpace ? (
|
| 369 |
<div className="space-y-2">
|
| 370 |
-
{/* Black title: pick a name (use wsGroupName; fallback "My Group") */}
|
| 371 |
<div className="text-[18px] font-semibold text-foreground truncate">
|
| 372 |
-
{
|
| 373 |
</div>
|
| 374 |
|
| 375 |
-
{/* Group number */}
|
| 376 |
<div className="text-[18px] font-semibold text-foreground">
|
| 377 |
-
Group {
|
| 378 |
</div>
|
| 379 |
</div>
|
| 380 |
) : (
|
|
|
|
| 381 |
/* ===== Team/Group: current style unchanged ===== */
|
| 382 |
<div className="rounded-2xl border bg-background overflow-hidden">
|
| 383 |
<div className="px-4 pt-4 pb-3 space-y-3">
|
|
@@ -562,8 +578,9 @@ export function LeftSidebar(props: Props) {
|
|
| 562 |
</div>
|
| 563 |
|
| 564 |
{/* 2) Group ↔ Saved Chat divider */}
|
| 565 |
-
<
|
| 566 |
-
|
|
|
|
| 567 |
|
| 568 |
{/* ================= MIDDLE (only scroll) ================= */}
|
| 569 |
<div className="flex-1 min-h-0 overflow-hidden">
|
|
@@ -581,7 +598,10 @@ export function LeftSidebar(props: Props) {
|
|
| 581 |
{/* ================= BOTTOM (fixed, non-scroll) ================= */}
|
| 582 |
<div className="flex-shrink-0">
|
| 583 |
{/* 3) Saved Chat ↔ Instructor divider */}
|
| 584 |
-
<
|
|
|
|
|
|
|
|
|
|
| 585 |
|
| 586 |
<div className="px-4 py-4 space-y-2 text-[16px]">
|
| 587 |
<div className="text-muted-foreground">
|
|
|
|
| 170 |
}, [spaceType, isMyWorkspace]);
|
| 171 |
|
| 172 |
// --------- CourseInfo resolution ---------
|
| 173 |
+
const demoGroupMap: Record<string, { name: string; no: number }> = {
|
| 174 |
+
"Introduction to AI": { name: "Foundations", no: 1 },
|
| 175 |
+
"Machine Learning": { name: "Model Builders", no: 3 },
|
| 176 |
+
"Data Visualization": { name: "Storytellers", no: 2 },
|
| 177 |
+
};
|
| 178 |
+
|
| 179 |
+
const demoGroup = useMemo(() => {
|
| 180 |
+
return demoGroupMap[courseName] ?? {
|
| 181 |
+
name: wsGroupName || "My Group",
|
| 182 |
+
no: toIntOrFallback(wsGroupNo, 1),
|
| 183 |
+
};
|
| 184 |
+
}, [courseName, wsGroupName, wsGroupNo]);
|
| 185 |
+
|
| 186 |
+
|
| 187 |
const courseInfo = useMemo((): CourseDirectoryItem | null => {
|
| 188 |
const list = Array.isArray(availableCourses) ? availableCourses : [];
|
| 189 |
|
|
|
|
| 371 |
</div>
|
| 372 |
|
| 373 |
{/* 1) Welcome ↔ Course divider */}
|
| 374 |
+
<div className="my-6">
|
| 375 |
+
<Divider />
|
| 376 |
+
</div>
|
| 377 |
+
|
| 378 |
|
| 379 |
{/* Course + Group */}
|
| 380 |
<div className="px-4 pt-10 pb-10 space-y-4">
|
| 381 |
<div className="text-[30px] leading-tight font-semibold">{courseName}</div>
|
| 382 |
|
| 383 |
+
|
| 384 |
+
{/* ===== My Space ===== */}
|
| 385 |
{!isTeamSpace ? (
|
| 386 |
<div className="space-y-2">
|
|
|
|
| 387 |
<div className="text-[18px] font-semibold text-foreground truncate">
|
| 388 |
+
{demoGroup.name}
|
| 389 |
</div>
|
| 390 |
|
|
|
|
| 391 |
<div className="text-[18px] font-semibold text-foreground">
|
| 392 |
+
Group {demoGroup.no}
|
| 393 |
</div>
|
| 394 |
</div>
|
| 395 |
) : (
|
| 396 |
+
|
| 397 |
/* ===== Team/Group: current style unchanged ===== */
|
| 398 |
<div className="rounded-2xl border bg-background overflow-hidden">
|
| 399 |
<div className="px-4 pt-4 pb-3 space-y-3">
|
|
|
|
| 578 |
</div>
|
| 579 |
|
| 580 |
{/* 2) Group ↔ Saved Chat divider */}
|
| 581 |
+
<div className="my-8">
|
| 582 |
+
<Divider />
|
| 583 |
+
</div>
|
| 584 |
|
| 585 |
{/* ================= MIDDLE (only scroll) ================= */}
|
| 586 |
<div className="flex-1 min-h-0 overflow-hidden">
|
|
|
|
| 598 |
{/* ================= BOTTOM (fixed, non-scroll) ================= */}
|
| 599 |
<div className="flex-shrink-0">
|
| 600 |
{/* 3) Saved Chat ↔ Instructor divider */}
|
| 601 |
+
<div className="my-6">
|
| 602 |
+
<Divider />
|
| 603 |
+
</div>
|
| 604 |
+
|
| 605 |
|
| 606 |
<div className="px-4 py-4 space-y-2 text-[16px]">
|
| 607 |
<div className="text-muted-foreground">
|