From ef2b99ff2d11263f952abc00de90bf6681f57d3d Mon Sep 17 00:00:00 2001 From: Lemon Date: Thu, 19 Mar 2026 13:34:59 -0700 Subject: [PATCH] Hoist inline style objects to module-level constants Avoid recreating style objects on every render in MobileBottomNav, FloatingComposeButton, and MobileDrawer by extracting them to module-level constants. --- src/components/FloatingComposeButton.tsx | 9 ++++++--- src/components/MobileBottomNav.tsx | 7 ++++++- src/components/MobileDrawer.tsx | 17 ++++++++--------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/components/FloatingComposeButton.tsx b/src/components/FloatingComposeButton.tsx index 10a6e452..5d7e2633 100644 --- a/src/components/FloatingComposeButton.tsx +++ b/src/components/FloatingComposeButton.tsx @@ -11,6 +11,11 @@ import { PlanetButton } from '@/components/icons/PlanetButton'; import { ReplyComposeModal } from '@/components/ReplyComposeModal'; import { useCurrentUser } from '@/hooks/useCurrentUser'; +/** Drop shadow style for the planet FAB — hoisted to avoid re-creating on every render. */ +const fabShadowStyle: React.CSSProperties = { + filter: 'drop-shadow(0 4px 12px hsl(var(--primary) / 0.4)) drop-shadow(0 2px 4px hsl(var(--primary) / 0.2))', +}; + interface FloatingComposeButtonProps { /** The Nostr event kind this FAB creates. kind=1 opens compose; others show "Coming soon". */ kind?: number; @@ -49,9 +54,7 @@ export function FloatingComposeButton({ kind = 1, href, onFabClick, icon }: Floa