Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Remove propTypes (#10432)
Browse files Browse the repository at this point in the history
  • Loading branch information
albarin authored Aug 2, 2023
1 parent 5413109 commit 8224a5c
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions assets/js/blocks/price-filter/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useCallback, useState, useEffect } from '@wordpress/element';
import PriceSlider from '@woocommerce/base-components/price-slider';
import FilterTitlePlaceholder from '@woocommerce/base-components/filter-placeholder';
import { useDebouncedCallback } from 'use-debounce';
import PropTypes from 'prop-types';
import { getCurrencyFromPriceResponse } from '@woocommerce/price-format';
import { getSettingWithCoercion } from '@woocommerce/settings';
import { addQueryArgs, removeQueryArgs } from '@wordpress/url';
Expand Down Expand Up @@ -72,6 +71,17 @@ function formatPrice( value: unknown, minorUnit: number ) {
return Number( value ) * 10 ** minorUnit;
}

interface PriceFilterBlockProps {
/**
* The attributes for this block.
*/
attributes: Attributes;
/**
* Whether it's in the editor or frontend display.
*/
isEditor: boolean;
}

/**
* Component displaying a price filter.
*
Expand All @@ -82,10 +92,7 @@ function formatPrice( value: unknown, minorUnit: number ) {
const PriceFilterBlock = ( {
attributes,
isEditor = false,
}: {
attributes: Attributes;
isEditor: boolean;
} ) => {
}: PriceFilterBlockProps ) => {
const setWrapperVisibility = useSetWraperVisibility();
const hasFilterableProducts = getSettingWithCoercion(
'has_filterable_products',
Expand Down Expand Up @@ -355,15 +362,4 @@ const PriceFilterBlock = ( {
);
};

PriceFilterBlock.propTypes = {
/**
* The attributes for this block.
*/
attributes: PropTypes.object.isRequired,
/**
* Whether it's in the editor or frontend display.
*/
isEditor: PropTypes.bool,
};

export default PriceFilterBlock;

0 comments on commit 8224a5c

Please sign in to comment.