mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Zen components conversion.
This commit is contained in:
parent
aac1a12e51
commit
5999bf6256
142 changed files with 1235 additions and 1454 deletions
|
|
@ -1,29 +1,29 @@
|
|||
import { ReactNode } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import Link from 'next/link';
|
||||
import { Button } from '@umami/react-zen';
|
||||
import { useLocale } from '@/components/hooks';
|
||||
// eslint-disable-next-line css-modules/no-unused-class
|
||||
import styles from './LinkButton.module.css';
|
||||
|
||||
export interface LinkButtonProps {
|
||||
href: string;
|
||||
className?: string;
|
||||
variant?: string;
|
||||
scroll?: boolean;
|
||||
variant?: any;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export function LinkButton({ href, className, variant, scroll = true, children }: LinkButtonProps) {
|
||||
export function LinkButton({
|
||||
href,
|
||||
variant = 'quiet',
|
||||
scroll = true,
|
||||
children,
|
||||
...props
|
||||
}: LinkButtonProps) {
|
||||
const { dir } = useLocale();
|
||||
|
||||
return (
|
||||
<Link
|
||||
className={classNames(styles.button, className, { [styles[variant]]: true })}
|
||||
href={href}
|
||||
dir={dir}
|
||||
scroll={scroll}
|
||||
>
|
||||
{children}
|
||||
</Link>
|
||||
<Button {...props} variant={variant} asChild>
|
||||
<Link href={href} dir={dir} scroll={scroll}>
|
||||
{children}
|
||||
</Link>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue