mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Refactor buttons.
This commit is contained in:
parent
000f84df96
commit
30b87bc4c4
16 changed files with 175 additions and 63 deletions
|
|
@ -3,10 +3,24 @@ import classNames from 'classnames';
|
|||
import Icon from './Icon';
|
||||
import styles from './Button.module.css';
|
||||
|
||||
export default function Button({ icon, type = 'button', children, className, onClick = () => {} }) {
|
||||
export default function Button({
|
||||
type = 'button',
|
||||
icon,
|
||||
size,
|
||||
children,
|
||||
className,
|
||||
onClick = () => {},
|
||||
}) {
|
||||
return (
|
||||
<button type={type} className={classNames(styles.button, className)} onClick={onClick}>
|
||||
{icon && <Icon icon={icon} />}
|
||||
<button
|
||||
type={type}
|
||||
className={classNames(styles.button, className, {
|
||||
[styles.small]: size === 'S',
|
||||
[styles.large]: size === 'L',
|
||||
})}
|
||||
onClick={onClick}
|
||||
>
|
||||
{icon && <Icon icon={icon} size={size} />}
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue