diff --git a/src/Header/Component.client.tsx b/src/Header/Component.client.tsx index 4dbd5c2..b20f657 100644 --- a/src/Header/Component.client.tsx +++ b/src/Header/Component.client.tsx @@ -59,7 +59,13 @@ export const HeaderClient: React.FC = ({ data, socialLinks = className="relative z-20 w-full bg-white dark:bg-fd-navy border-b border-transparent dark:border-white/10" {...(theme ? { 'data-theme': theme } : {})} > -
+ {/* + * Replaced `container` with consistent edge-pinned padding. + * px-6 (24px) on mobile, px-8 (32px) on tablet, px-12 (48px) on desktop. + * No max-width — logo and nav stay near the viewport edges at all sizes. + * No more jumping between breakpoints. + */} +
diff --git a/src/components/AnnouncementBar/AnnouncementBar.tsx b/src/components/AnnouncementBar/AnnouncementBar.tsx index 4631875..fa429e8 100644 --- a/src/components/AnnouncementBar/AnnouncementBar.tsx +++ b/src/components/AnnouncementBar/AnnouncementBar.tsx @@ -32,16 +32,24 @@ export const AnnouncementBarComponent: React.FC = ({ dismissible = true, backgroundColor = 'yellow', }) => { - const [dismissed, setDismissed] = useState(false) + /* + * Start as 'unknown' — don't render anything until we've checked localStorage. + * This prevents the flash where the bar shows then immediately hides. + * null = hasn't checked yet, true = dismissed, false = should show + */ + const [dismissed, setDismissed] = useState(null) useEffect(() => { const key = `fd-announcement-${text?.slice(0, 20)}` if (typeof window !== 'undefined' && localStorage.getItem(key) === 'dismissed') { setDismissed(true) + } else { + setDismissed(false) } }, [text]) - if (dismissed || !text) return null + // Don't render until we know the dismiss state (prevents flash) + if (dismissed === null || dismissed === true || !text) return null const bgClass = backgroundColor === 'navy' ? 'bg-fd-navy text-white' : @@ -57,19 +65,15 @@ export const AnnouncementBarComponent: React.FC = ({ const href = resolveUrl(buttonLink) const newTab = buttonLink?.newTab ?? false - /* - * If a link is provided, the entire text becomes clickable. - * buttonLabel is appended to the text with an arrow if present, - * but it's all one inline link — no alignment issues. - */ const displayText = buttonLabel ? `${text} ${buttonLabel} →` : text return (
-