fix: navbar links

This commit is contained in:
TrèsAbhi committed 2024-08-20 11:12:22 -05:00
1 parent 631dc547fa
commit 5b3723322e
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ import { useRouter } from 'next/navigation';
import { forwardRef } from 'react'; import { forwardRef } from 'react';
export const Link = forwardRef<HTMLAnchorElement, LinkProps>( export const Link = forwardRef<HTMLAnchorElement, LinkProps>(
({ href, onClick, ...props }, ref) => { ({ href, onClick, target, ...props }, ref) => {
const router = useRouter(); const router = useRouter();
return ( return (
@@ -15,7 +15,7 @@ export const Link = forwardRef<HTMLAnchorElement, LinkProps>(
onClick={(event) => { onClick={(event) => {
event.preventDefault(); event.preventDefault();
if (href) { if (href) {
if (event.ctrlKey || event.metaKey) { if (event.ctrlKey || event.metaKey || target === '_blank') {
window.open(href); window.open(href);
} else { } else {
router.push(href); router.push(href);
+2 -2
View File
@@ -95,7 +95,7 @@ export default function Navbar() {
color="gray" color="gray"
highContrast={selected} highContrast={selected}
size="2" size="2"
href={`tools/${tool.id}`} href={`/tools/${tool.id}`}
underline={selected ? 'always' : 'hover'} underline={selected ? 'always' : 'hover'}
> >
{tool.title} {tool.title}
@@ -121,7 +121,7 @@ export default function Navbar() {
<Link <Link
style={{ display: 'flex', alignContent: 'center' }} style={{ display: 'flex', alignContent: 'center' }}
color="gray" color="gray"
href="https://discord.gg/nDt7AjGJQH" href="https://www.patreon.com/tresabhi"
underline="none" underline="none"
target="_blank" target="_blank"
onClick={() => setShowHamburgerMenu(false)} onClick={() => setShowHamburgerMenu(false)}