From 5a08350b6a137e7bcf39228df130c6fb4a0c924d Mon Sep 17 00:00:00 2001 From: syntaxbullet Date: Thu, 9 Jul 2026 12:19:40 +0200 Subject: [PATCH] feat: implement login intent filtering for navigation links and remove unused components --- .netlify/netlify.toml | 27 ------------------- src/components/Link/index.tsx | 3 ++- src/spa/cmsNavigation.ts | 8 ++++-- src/spa/components/layout/Layout.tsx | 40 ++++------------------------ src/spa/loginIntent.ts | 1 + src/spa/pages/Participation.tsx | 33 ----------------------- src/spa/router.tsx | 7 ++++- 7 files changed, 20 insertions(+), 99 deletions(-) delete mode 100644 .netlify/netlify.toml create mode 100644 src/spa/loginIntent.ts diff --git a/.netlify/netlify.toml b/.netlify/netlify.toml deleted file mode 100644 index 8f2e5f6..0000000 --- a/.netlify/netlify.toml +++ /dev/null @@ -1,27 +0,0 @@ -plugins = [] -headers = [] -redirects = [] - -[functions] - -[functions."*"] - -[build] -publish = "/Users/gsebastianp/.gemini/antigravity/scratch/bmp-website/dist" -publishOrigin = "ui" -commandOrigin = "ui" -command = "npm run build" - -[build.environment] - -[build.processing] - -[build.processing.css] - -[build.processing.html] - -[build.processing.images] - -[build.processing.js] - -[build.services] \ No newline at end of file diff --git a/src/components/Link/index.tsx b/src/components/Link/index.tsx index 0cf220e..b9b4f05 100644 --- a/src/components/Link/index.tsx +++ b/src/components/Link/index.tsx @@ -1,4 +1,5 @@ import { Button, type ButtonProps } from '@/components/ui/button' +import { isLoginIntentHref } from '@/spa/loginIntent' import { cn } from '@/utilities/ui' import Link from 'next/link' import React from 'react' @@ -40,7 +41,7 @@ export const CMSLink: React.FC = (props) => { }` : url - if (!href) return null + if (!href || isLoginIntentHref(href)) return null const size = appearance === 'link' ? 'clear' : sizeFromProps const newTabProps = newTab ? { rel: 'noopener noreferrer', target: '_blank' } : {} diff --git a/src/spa/cmsNavigation.ts b/src/spa/cmsNavigation.ts index bdb6787..762be2b 100644 --- a/src/spa/cmsNavigation.ts +++ b/src/spa/cmsNavigation.ts @@ -1,4 +1,5 @@ import type { Footer, Header, Media } from '@/payload-types' +import { isLoginIntentHref } from '@/spa/loginIntent' export type SpaIconName = 'instagram' | 'linkedin' | 'facebook' export type SpaLink = { label: string; path: string } @@ -187,6 +188,9 @@ const withoutParticipationCriteriaLink = (items: SpaHeaderNavItem[]) => : item, ) +export const withoutLoginCtas = (items: SpaCtaLink[]) => + items.filter((item) => item.variant !== 'login' && !isLoginIntentHref(item.path)) + type FooterPartnerLogo = { alt?: string image?: unknown @@ -208,7 +212,7 @@ export function normalizeHeaderData(header?: Partial
): SpaHeaderData { socialLinks: header?.socialLinks?.length ? (header.socialLinks as unknown as SpaSocialLink[]) : defaultHeaderData.socialLinks, - ctas: header?.ctas?.length ? (header.ctas as unknown as SpaCtaLink[]) : defaultHeaderData.ctas, + ctas: withoutLoginCtas(header?.ctas?.length ? (header.ctas as unknown as SpaCtaLink[]) : defaultHeaderData.ctas), } } @@ -217,7 +221,7 @@ export function normalizeFooterData(footer?: Partial