Button update
This commit is contained in:
1 parent
8ba8b0d05b
commit
585d3ae75c
2 files changed
+5
-3
No files matched your search
@@ -32,10 +32,10 @@ export const Button: React.FC<ButtonProps> = ({ size = "default", theme = "defau
|
|||||||
[s.disabled]: disabled,
|
[s.disabled]: disabled,
|
||||||
})
|
})
|
||||||
const onClick = useCallback<MouseEventHandler<HTMLButtonElement>>(event => {
|
const onClick = useCallback<MouseEventHandler<HTMLButtonElement>>(event => {
|
||||||
if (props.onClick) {
|
if (typeof props.onClick === "function") {
|
||||||
props.onClick(props.value, event)
|
props.onClick(props.value, event)
|
||||||
}
|
}
|
||||||
}, [props.value, props.onClick])
|
}, [props])
|
||||||
|
|
||||||
if (props.href) {
|
if (props.href) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
.button {
|
.button {
|
||||||
display: block;
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
font-size: var(--font-size-default);
|
font-size: var(--font-size-default);
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
Reference in new issue
Block a user