Merge pull request 'Link component fully covered' (#28) from feature/link-component into develop
Reviewed-on: http://85.143.176.51:3000/free-land/front-end/pulls/28
This commit is contained in:
commit
39a7f64252
21
src/components/typography/Link.tsx
Normal file
21
src/components/typography/Link.tsx
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
href?: string;
|
||||||
|
children: React.ReactNode;
|
||||||
|
disabled?: boolean;
|
||||||
|
className?: string;
|
||||||
|
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "">;
|
||||||
|
|
||||||
|
export default function Link({ href, children, disabled, ...props }: Props) {
|
||||||
|
return (
|
||||||
|
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
||||||
|
<a
|
||||||
|
href={disabled ? undefined : href}
|
||||||
|
aria-disabled={disabled}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user