This commit is contained in:
Albert Juhé Lluveras 2019-12-12 20:16:39 +01:00 committed by GitHub
parent bd4b57074e
commit b5791d9c53
4 changed files with 14 additions and 10 deletions

View File

@ -10,11 +10,14 @@ import classNames from 'classnames';
*/
import './style.scss';
const SubmitButton = ( { className, disabled, onClick } ) => {
const FilterSubmitButton = ( { className, disabled, onClick } ) => {
return (
<button
type="submit"
className={ classNames( 'wc-block-submit-button', className ) }
className={ classNames(
'wc-block-filter-submit-button',
className
) }
disabled={ disabled }
onClick={ onClick }
>
@ -24,7 +27,8 @@ const SubmitButton = ( { className, disabled, onClick } ) => {
);
};
SubmitButton.propTypes = {
FilterSubmitButton.propTypes = {
className: PropTypes.string,
/**
* Is the button disabled?
*/
@ -35,8 +39,8 @@ SubmitButton.propTypes = {
onClick: PropTypes.func.isRequired,
};
SubmitButton.defaultProps = {
FilterSubmitButton.defaultProps = {
disabled: false,
};
export default SubmitButton;
export default FilterSubmitButton;

View File

@ -1,4 +1,4 @@
.wc-block-submit-button {
.wc-block-filter-submit-button {
display: block;
margin-left: auto;
white-space: nowrap;

View File

@ -19,7 +19,7 @@ import classnames from 'classnames';
import './style.scss';
import { constrainRangeSliderValues } from './utils';
import { formatPrice } from '../../utils/price';
import SubmitButton from '../submit-button';
import FilterSubmitButton from '../filter-submit-button';
import PriceLabel from './price-label';
import PriceInput from './price-input';
@ -309,7 +309,7 @@ const PriceSlider = ( {
/>
) }
{ showFilterButton && (
<SubmitButton
<FilterSubmitButton
className="wc-block-price-filter__button"
disabled={ isLoading || ! hasValidConstraints }
onClick={ onSubmit }

View File

@ -19,7 +19,7 @@ import {
} from '@wordpress/element';
import CheckboxList from '@woocommerce/base-components/checkbox-list';
import DropdownSelector from '@woocommerce/base-components/dropdown-selector';
import SubmitButton from '@woocommerce/base-components/submit-button';
import FilterSubmitButton from '@woocommerce/base-components/filter-submit-button';
import isShallowEqual from '@wordpress/is-shallow-equal';
/**
@ -346,7 +346,7 @@ const AttributeFilterBlock = ( {
/>
) }
{ blockAttributes.showFilterButton && (
<SubmitButton
<FilterSubmitButton
className="wc-block-attribute-filter__button"
disabled={ isLoading || isDisabled }
onClick={ onSubmit }