mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 08:52:26 +00:00
Fix button props
This commit is contained in:
parent
b93159b9a4
commit
c77b681a89
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"languages": ["en", "fr"],
|
"languages": ["en", "fr"],
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"ports": [3000]
|
"ports": [3000, 5000, 8000]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,11 @@ import cn from 'classnames';
|
|||||||
import styles from './styles.scss';
|
import styles from './styles.scss';
|
||||||
|
|
||||||
function Button(props) {
|
function Button(props) {
|
||||||
|
const buttonProps = Object.assign({}, props);
|
||||||
|
const propsToDelete = ['loader', 'primary', 'primaryAddShape', 'secondary', 'secondaryHotline', 'secondaryHotlineAdd', 'kind'];
|
||||||
|
|
||||||
|
propsToDelete.map((value) => delete buttonProps[value]);
|
||||||
|
|
||||||
if (props.loader) {
|
if (props.loader) {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
@ -28,7 +33,7 @@ function Button(props) {
|
|||||||
|
|
||||||
)}
|
)}
|
||||||
disabled
|
disabled
|
||||||
{...props}
|
{...buttonProps}
|
||||||
>
|
>
|
||||||
<div className={styles.saving}>
|
<div className={styles.saving}>
|
||||||
<span>.</span><span>.</span><span>.</span>
|
<span>.</span><span>.</span><span>.</span>
|
||||||
@ -51,7 +56,7 @@ function Button(props) {
|
|||||||
props.className,
|
props.className,
|
||||||
)}
|
)}
|
||||||
type={props.type || 'button'}
|
type={props.type || 'button'}
|
||||||
{...props}
|
{...buttonProps}
|
||||||
>
|
>
|
||||||
{label}
|
{label}
|
||||||
</button>
|
</button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user