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