mirror of
https://github.com/block/buzz.git
synced 2026-10-28 21:11:48 +00:00
fix(desktop): simplify profile popover header (#853)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,7 +6,6 @@ import { ProfileAvatar } from "@/features/profile/ui/ProfileAvatar";
|
|||||||
import { PresenceDot } from "@/features/presence/ui/PresenceBadge";
|
import { PresenceDot } from "@/features/presence/ui/PresenceBadge";
|
||||||
import { getPresenceLabel } from "@/features/presence/lib/presence";
|
import { getPresenceLabel } from "@/features/presence/lib/presence";
|
||||||
import { SetStatusDialog } from "@/features/user-status/ui/SetStatusDialog";
|
import { SetStatusDialog } from "@/features/user-status/ui/SetStatusDialog";
|
||||||
import { StatusEmoji } from "@/features/user-status/ui/StatusEmoji";
|
|
||||||
import type { PresenceStatus } from "@/shared/api/types";
|
import type { PresenceStatus } from "@/shared/api/types";
|
||||||
import { isMacPlatform } from "@/shared/lib/platform";
|
import { isMacPlatform } from "@/shared/lib/platform";
|
||||||
|
|
||||||
@@ -18,7 +17,6 @@ interface ProfilePopoverProps {
|
|||||||
open: boolean;
|
open: boolean;
|
||||||
onOpenChange: (open: boolean) => void;
|
onOpenChange: (open: boolean) => void;
|
||||||
displayName: string;
|
displayName: string;
|
||||||
nip05?: string | null;
|
|
||||||
avatarUrl: string | null;
|
avatarUrl: string | null;
|
||||||
currentStatus: PresenceStatus;
|
currentStatus: PresenceStatus;
|
||||||
isStatusPending?: boolean;
|
isStatusPending?: boolean;
|
||||||
@@ -56,7 +54,6 @@ export function ProfilePopover({
|
|||||||
open,
|
open,
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
displayName,
|
displayName,
|
||||||
nip05,
|
|
||||||
avatarUrl,
|
avatarUrl,
|
||||||
currentStatus,
|
currentStatus,
|
||||||
isStatusPending,
|
isStatusPending,
|
||||||
@@ -154,31 +151,13 @@ export function ProfilePopover({
|
|||||||
<p className="truncate text-sm font-semibold leading-tight text-popover-foreground">
|
<p className="truncate text-sm font-semibold leading-tight text-popover-foreground">
|
||||||
{displayName}
|
{displayName}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex items-center gap-1.5 text-xs text-muted-foreground">
|
<div
|
||||||
{nip05 ? <span className="truncate">@{nip05}</span> : null}
|
className="inline-flex items-center gap-1.5 text-xs text-muted-foreground"
|
||||||
{nip05 ? <span aria-hidden="true">·</span> : null}
|
data-testid="profile-popover-current-status"
|
||||||
<span
|
>
|
||||||
className="inline-flex items-center gap-1.5"
|
<PresenceDot status={currentStatus} />
|
||||||
data-testid="profile-popover-current-status"
|
<span>{getPresenceLabel(currentStatus)}</span>
|
||||||
>
|
|
||||||
<PresenceDot status={currentStatus} />
|
|
||||||
<span>{getPresenceLabel(currentStatus)}</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
{hasUserStatus ? (
|
|
||||||
<p
|
|
||||||
className="mt-0.5 truncate text-xs text-muted-foreground"
|
|
||||||
data-testid="profile-popover-user-status"
|
|
||||||
>
|
|
||||||
{userStatusEmoji ? (
|
|
||||||
<StatusEmoji
|
|
||||||
className="mr-1 h-3.5 w-3.5"
|
|
||||||
value={userStatusEmoji}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
{userStatusText}
|
|
||||||
</p>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ export function SidebarProfileCard({
|
|||||||
open={profilePopoverOpen}
|
open={profilePopoverOpen}
|
||||||
onOpenChange={setProfilePopoverOpen}
|
onOpenChange={setProfilePopoverOpen}
|
||||||
displayName={resolvedDisplayName}
|
displayName={resolvedDisplayName}
|
||||||
nip05={profile?.nip05Handle}
|
|
||||||
avatarUrl={profile?.avatarUrl ?? null}
|
avatarUrl={profile?.avatarUrl ?? null}
|
||||||
currentStatus={selfPresenceStatus}
|
currentStatus={selfPresenceStatus}
|
||||||
isStatusPending={isPresencePending}
|
isStatusPending={isPresencePending}
|
||||||
|
|||||||
Reference in New Issue
Block a user