From c414b7d1f2827d2b2e5734c2c6e590a16fad7da4 Mon Sep 17 00:00:00 2001 From: Arnie Date: Fri, 2 Jun 2023 13:44:11 +0200 Subject: [PATCH] Change navigation headline to allow href attributes --- .../components/Navigation/NavigationHeadline.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/frontend/src/components/Navigation/NavigationHeadline.tsx b/app/frontend/src/components/Navigation/NavigationHeadline.tsx index 2897b26..b0ef547 100644 --- a/app/frontend/src/components/Navigation/NavigationHeadline.tsx +++ b/app/frontend/src/components/Navigation/NavigationHeadline.tsx @@ -15,17 +15,25 @@ const Link = styled(RouterLink)({ textDecoration: "none", }); -type NavigationHeadlineProps = Partial>; +type NavigationHeadlineProps = + | (Partial> & { + href?: undefined; + }) + | { + href?: string; + to?: undefined; + }; const NavigationHeadline: React.FC< React.PropsWithChildren > = (props) => { - const { children, to } = props; + const { children, href, to } = props; return ( {to && {children}} - {!to && children} + {href && {children}} + {!to && !href && children} ); };