mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +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';
|
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);
|
||||||
|
|||||||
@@ -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)}
|
||||||
|
|||||||
Reference in new issue
Block a user