/
WithButtonStyles.tsx
47 lines (43 loc) · 1 KB
/
WithButtonStyles.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import type { ReactElement } from "react";
import cn from "classnames";
import type { ButtonThemeProps } from "@react-md/button";
import { buttonThemeClassNames } from "@react-md/button";
import type { LinkProps } from "@react-md/link";
import { Link } from "@react-md/link";
import styles from "./WithButtonStyles.module.scss";
function LinkStyledButton({
className,
theme,
themeType,
buttonType,
disabled,
children,
...props
}: ButtonThemeProps & LinkProps): ReactElement {
return (
<Link
{...props}
className={buttonThemeClassNames({
disabled,
theme,
themeType,
buttonType,
className: cn(styles.link, className),
})}
>
{children}
</Link>
);
}
LinkStyledButton.defaultProps = {
theme: "primary",
themeType: "contained",
buttonType: "text",
};
export default function WithButtonStyles(): ReactElement {
return (
<LinkStyledButton href="https://react-md.dev">
https://react-md.dev
</LinkStyledButton>
);
}