mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix: navbar links
This commit is contained in:
1 parent
631dc547fa
commit
5b3723322e
2 files changed
+4
-4
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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)}
|
||||
|
||||
Reference in new issue
Block a user