SarahXia0405 commited on
Commit
105f096
·
verified ·
1 Parent(s): 715cf87

Update web/src/components/sidebar/LeftSidebar.tsx

Browse files
web/src/components/sidebar/LeftSidebar.tsx CHANGED
@@ -6,14 +6,7 @@ import { Badge } from "../ui/badge";
6
 
7
  import { SavedChatSection } from "./SavedChatSection";
8
 
9
- import {
10
- Pencil,
11
- Check,
12
- X,
13
- MailPlus,
14
- Users,
15
- GraduationCap,
16
- } from "lucide-react";
17
  import { toast } from "sonner";
18
 
19
  import {
@@ -98,17 +91,6 @@ function norm(s: any) {
98
  return String(s ?? "").trim().toLowerCase();
99
  }
100
 
101
- function getUserName(u: User | null) {
102
- const anyU = u as any;
103
- return (
104
- anyU?.name ||
105
- anyU?.fullName ||
106
- anyU?.username ||
107
- anyU?.email?.split?.("@")?.[0] ||
108
- "there"
109
- );
110
- }
111
-
112
  function pickAny(obj: any, keys: string[]) {
113
  for (const k of keys) {
114
  const v = obj?.[k];
@@ -335,21 +317,19 @@ export function LeftSidebar(props: Props) {
335
  const taName = (courseInfo as any)?.teachingAssistant?.name ?? "N/A";
336
  const taEmail = String((courseInfo as any)?.teachingAssistant?.email ?? "").trim();
337
 
338
- const displayName = useMemo(() => getUserName(user), [user]);
339
-
340
  return (
341
  <div className="h-full w-full flex flex-col min-h-0 bg-background text-foreground">
342
  {/* ================= TOP (non-scroll) ================= */}
343
  <div className="flex-shrink-0">
344
- {/* Welcome */}
345
 
346
- <div className="mt-2 mb-4">
347
- <Divider />
348
- </div>
349
 
350
  {/* Course + Group */}
351
  <div className="px-4 pt-5 pb-6 space-y-4">
352
- {/* Course row with icon (single-color, no container) */}
353
  <div className="flex items-start gap-3">
354
  <div className="w-6 flex items-start justify-center flex-shrink-0 pt-[2px]">
355
  <GraduationCap className="w-5 h-5 text-muted-foreground" />
@@ -357,7 +337,6 @@ export function LeftSidebar(props: Props) {
357
  <div className="text-[22px] leading-snug font-semibold truncate">{courseName}</div>
358
  </div>
359
 
360
-
361
  {/* ===== My Space (beautified) ===== */}
362
  {!isTeamSpace ? (
363
  <div className="space-y-2">
@@ -371,7 +350,7 @@ export function LeftSidebar(props: Props) {
371
  </div>
372
  </div>
373
  ) : (
374
- /* ===== Team/Group (keep your original editable card) ===== */
375
  <div className="rounded-2xl border bg-background overflow-hidden">
376
  <div className="px-4 pt-4 pb-3 space-y-3">
377
  {/* Line 1: group name editable */}
 
6
 
7
  import { SavedChatSection } from "./SavedChatSection";
8
 
9
+ import { Pencil, Check, X, MailPlus, Users, GraduationCap } from "lucide-react";
 
 
 
 
 
 
 
10
  import { toast } from "sonner";
11
 
12
  import {
 
91
  return String(s ?? "").trim().toLowerCase();
92
  }
93
 
 
 
 
 
 
 
 
 
 
 
 
94
  function pickAny(obj: any, keys: string[]) {
95
  for (const k of keys) {
96
  const v = obj?.[k];
 
317
  const taName = (courseInfo as any)?.teachingAssistant?.name ?? "N/A";
318
  const taEmail = String((courseInfo as any)?.teachingAssistant?.email ?? "").trim();
319
 
 
 
320
  return (
321
  <div className="h-full w-full flex flex-col min-h-0 bg-background text-foreground">
322
  {/* ================= TOP (non-scroll) ================= */}
323
  <div className="flex-shrink-0">
324
+ {/* ✅ removed Welcome section entirely */}
325
 
326
+ <div className="mt-2 mb-4">
327
+ <Divider />
328
+ </div>
329
 
330
  {/* Course + Group */}
331
  <div className="px-4 pt-5 pb-6 space-y-4">
332
+ {/* Course row with icon (single-color, no container/background) */}
333
  <div className="flex items-start gap-3">
334
  <div className="w-6 flex items-start justify-center flex-shrink-0 pt-[2px]">
335
  <GraduationCap className="w-5 h-5 text-muted-foreground" />
 
337
  <div className="text-[22px] leading-snug font-semibold truncate">{courseName}</div>
338
  </div>
339
 
 
340
  {/* ===== My Space (beautified) ===== */}
341
  {!isTeamSpace ? (
342
  <div className="space-y-2">
 
350
  </div>
351
  </div>
352
  ) : (
353
+ /* ===== Team/Group (editable card) ===== */
354
  <div className="rounded-2xl border bg-background overflow-hidden">
355
  <div className="px-4 pt-4 pb-3 space-y-3">
356
  {/* Line 1: group name editable */}