Skip to content

Commit

Permalink
fix: Fixed external links in mobile navbar (#443)
Browse files Browse the repository at this point in the history
* fixed external links for mobile navbar

* removed comments
  • Loading branch information
jaswinder6991 authored Nov 4, 2023
1 parent 7699be1 commit 3a099ee
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions src/devhub/components/organism/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,27 @@ return (
{link.title}
</MobileLink>
) : (
link.links.map((it, idx) => (
<MobileLink
key={`nested-link-${idx}`}
className={link.href === props.page && "active"}
href={`/${REPL_DEVHUB}/widget/app?page=${it.href}`}
>
{it.title}
</MobileLink>
))
link.links.map((it, idx) =>
it.href.startsWith("http://") ||
it.href.startsWith("https://") ? (
<MobileLink
key={`nested-link-${idx}`}
className={link.href === props.page && "active"}
href={it.href}
target="no_blank"
>
/{it.title}
</MobileLink>
) : (
<MobileLink
key={`nested-link-${idx}`}
className={link.href === props.page && "active"}
href={`/${REPL_DEVHUB}/widget/app?page=${it.href}`}
>
/{it.title}
</MobileLink>
)
)
)
)}
</div>
Expand Down

0 comments on commit 3a099ee

Please sign in to comment.