mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: use new link component in navbar
This commit is contained in:
1 parent
5c328d0f4d
commit
0c5bf85bc5
2 files changed
+6
-6
No files matched your search
@@ -1,13 +1,13 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { LinkProps } from '@radix-ui/themes';
|
import { LinkProps, Link as RadixLink } from '@radix-ui/themes';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
export function Link({ href, onClick, ...props }: LinkProps) {
|
export function Link({ href, onClick, ...props }: LinkProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link
|
<RadixLink
|
||||||
href={href}
|
href={href}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import {
|
|||||||
Spinner,
|
Spinner,
|
||||||
Text,
|
Text,
|
||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
import Link from 'next/link';
|
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
import { Suspense, useState } from 'react';
|
import { Suspense, useState } from 'react';
|
||||||
import { REGIONS, UNLOCALIZED_REGION_NAMES } from '../../constants/regions';
|
import { REGIONS, UNLOCALIZED_REGION_NAMES } from '../../constants/regions';
|
||||||
@@ -28,6 +27,7 @@ import { BlitzkitWide } from '../../icons/BlitzkitWide';
|
|||||||
import { PatreonIcon } from '../../icons/Patreon';
|
import { PatreonIcon } from '../../icons/Patreon';
|
||||||
import { theme } from '../../stitches.config';
|
import { theme } from '../../stitches.config';
|
||||||
import { useApp } from '../../stores/app';
|
import { useApp } from '../../stores/app';
|
||||||
|
import { Link } from '../Link';
|
||||||
import { LoggedIn } from './components/LoggedIn';
|
import { LoggedIn } from './components/LoggedIn';
|
||||||
import * as styles from './index.css';
|
import * as styles from './index.css';
|
||||||
|
|
||||||
@@ -81,8 +81,9 @@ export default function Navbar() {
|
|||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
key={tool.id}
|
key={tool.id}
|
||||||
data-accent-color="gray"
|
color="gray"
|
||||||
className={`rt-Text rt-reset rt-Link rt-r-size-2 rt-underline-${selected ? 'always' : 'hover'}`}
|
size="2"
|
||||||
|
underline={selected ? 'always' : 'hover'}
|
||||||
href={`/tools/${tool.id}`}
|
href={`/tools/${tool.id}`}
|
||||||
>
|
>
|
||||||
{tool.title}
|
{tool.title}
|
||||||
@@ -188,7 +189,6 @@ export default function Navbar() {
|
|||||||
<Link
|
<Link
|
||||||
key={tool.id}
|
key={tool.id}
|
||||||
href={`/tools/${tool.id}`}
|
href={`/tools/${tool.id}`}
|
||||||
target={tool.href ? '_blank' : undefined}
|
|
||||||
className={styles.toolCard}
|
className={styles.toolCard}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(/assets/banners/${tool.id}.webp)`,
|
backgroundImage: `url(/assets/banners/${tool.id}.webp)`,
|
||||||
|
|||||||
Reference in new issue
Block a user