mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
feat: new homepage
This commit is contained in:
1 parent
847d605f08
commit
3d2b443dc7
4 files changed
+164
-40
No files matched your search
+13
-22
@@ -1,29 +1,20 @@
|
||||
import {
|
||||
Link as RadixLink,
|
||||
LinkProps as RadixLinkProps,
|
||||
} from '@radix-ui/themes';
|
||||
import NextLink from 'next/link';
|
||||
'use client';
|
||||
|
||||
interface LinkProps extends RadixLinkProps {
|
||||
href: string;
|
||||
}
|
||||
import { LinkProps } from '@radix-ui/themes';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
export function Link({ href, onClick, ...props }: LinkProps) {
|
||||
const router = useRouter();
|
||||
|
||||
export function Link({ href, children, target, onClick, ...props }: LinkProps) {
|
||||
return (
|
||||
<RadixLink
|
||||
<Link
|
||||
href={href}
|
||||
onClick={(event) => event.preventDefault()}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
if (href) router.push(href);
|
||||
onClick?.(event);
|
||||
}}
|
||||
{...props}
|
||||
>
|
||||
<NextLink
|
||||
tabIndex={-1}
|
||||
href={href}
|
||||
target={target}
|
||||
onClick={onClick}
|
||||
style={{ all: 'inherit' }}
|
||||
>
|
||||
{children}
|
||||
</NextLink>
|
||||
</RadixLink>
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user