From f646d5aa14ed5715acec2c205e4e895a092d4890 Mon Sep 17 00:00:00 2001 From: SkateSpots Date: Sat, 31 Oct 2026 16:57:42 +0700 Subject: [PATCH] ui: quiet and compact desktop status control --- src/components/Layout.tsx | 56 +++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 392a541..988ab92 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -54,9 +54,11 @@ import { ChevronDown, ArrowLeft, Search, + SmilePlus, } from 'lucide-react'; import { OfflineIndicator } from '@/components/OfflineIndicator'; import { UserStatusIndicator } from '@/components/UserStatusIndicator'; +import { SKATING_STATUSES, useUserStatus } from '@/hooks/useUserStatus'; import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'; import { useAuthor } from '@/hooks/useAuthor'; import { genUserName } from '@/lib/genUserName'; @@ -474,6 +476,45 @@ function MobileNav({ ); } +/** + * Compact desktop status control. The old outlined pill + permanent ping read + * like an alert; this shows the current status as a quiet chip and falls back + * to a neutral "Status" affordance when none is set. + */ +function DesktopStatusButton({ onOpen }: { onOpen: () => void }) { + const { user } = useCurrentUser(); + const { t } = useTranslation(); + const { data: status } = useUserStatus(user?.pubkey); + const preset = status?.statusId + ? SKATING_STATUSES.find((item) => item.id === status.statusId) + : null; + const label = preset ? t(preset.labelKey) : status?.status; + const emoji = status?.emoji || preset?.emoji; + + return ( + + ); +} + export function Layout({ children, noPadding }: LayoutProps) { const location = useLocation(); const navigate = useNavigate(); @@ -752,20 +793,7 @@ export function Layout({ children, noPadding }: LayoutProps) { )} {/* Status Quick Access - Desktop */} - {user && ( - - )} + {user && setShowStatusDialog(true)} />}