diff --git a/components/settings/SettingsProfileCard.tsx b/components/settings/SettingsProfileCard.tsx
index 8d4b953..acc64fb 100644
--- a/components/settings/SettingsProfileCard.tsx
+++ b/components/settings/SettingsProfileCard.tsx
@@ -1,22 +1,24 @@
/**
* @file components/settings/SettingsProfileCard.tsx
- * @description Card component managing user profile overview, status picker, and color selection.
+ * @description Collapsible card component managing user profile overview, status picker, and color selection.
*/
"use client";
+import { useState } from "react";
import { UserAvatar } from "@/components/ui/UserAvatar";
import { UserStatus } from "@/db/schema";
import {
MEMBER_STATUS_COLOR_CLASSES,
MEMBER_COLOR_OPTIONS,
} from "@/lib/constants/member.styles";
-import { UserRound, Palette } from "lucide-react";
+import { UserRound, Palette, ChevronDown } from "lucide-react";
import { useUser } from "@/lib/context/UserContext";
/** Props for the SettingsProfileCard component. */
interface SettingsProfileCardProps {
onUpdate: (fields: Partial<{ status: UserStatus; color: string }>) => void;
+ defaultOpen?: boolean;
}
const STATUSES: { label: string; value: UserStatus }[] = [
@@ -26,80 +28,101 @@ const STATUSES: { label: string; value: UserStatus }[] = [
{ label: "DND", value: "DND" },
];
-/** Renders a card for managing user profile details, online status, and theme color preferences. */
-export function SettingsProfileCard({ onUpdate }: SettingsProfileCardProps) {
+/** Renders a collapsible card for managing user profile details, status, and theme color. */
+export function SettingsProfileCard({
+ onUpdate,
+ defaultOpen = true,
+}: SettingsProfileCardProps) {
+ const [isOpen, setIsOpen] = useState(defaultOpen);
const { currentUser } = useUser();
if (!currentUser) return null;
return (
-
- {/* User Info Header */}
-
-
-
-
- {currentUser.username}
-
-
{currentUser.email}
+
+ {/* Clickable Header / Toggle Bar */}
+
- {/* Status Selection */}
-
-
- Online Status
-
-
- {STATUSES.map((status) => {
- const isSelected = currentUser.status === status.value;
- return (
-
- );
- })}
-
-
+
+
- {/* Color Palette Selection */}
-
-
- Profile Color
-
-
- {MEMBER_COLOR_OPTIONS.map((colorClass) => {
- const isSelected = currentUser.color === colorClass;
- return (
-
+ )}
);
}