Skip to content

Commit 0f7eae7

Browse files
authored
Merge pull request #1156 from ZopaPublic/nav-new-tab
feat: make theme navbar link open in a new tab
2 parents 95f4d4c + 7089b76 commit 0f7eae7

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.changeset/spicy-spies-judge.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@zopauk/react-components': patch
3+
---
4+
5+
Make theme navbar link open in a new tab

src/components/organisms/NavbarLite/NavbarLite.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@ const NavbarLiteWrapper = ({ children, isCobranded }: React.PropsWithChildren<Na
206206
<PageNavigation overlap={overThreshold} collapsed theme={theme}>
207207
<ConditionalWrapper
208208
condition={typeof theme.navbar.href !== 'undefined'}
209-
wrapper={(children) => <a href={theme?.navbar?.href}>{children}</a>}
209+
wrapper={(children) => (
210+
<a href={theme?.navbar?.href} target="_blank" title="Link opens in a new tab" rel="noreferrer">
211+
{children}
212+
</a>
213+
)}
210214
>
211215
<Headroom
212216
wrapperStyle={{ maxHeight: overThreshold ? `${navbarClosedHeight}px` : `${navbarOpenHeight}px` }}

0 commit comments

Comments
 (0)