removed proptypes from feedback-promt (https://github.com/woocommerce/woocommerce-blocks/pull/9838)
This commit is contained in:
parent
ad0509f767
commit
73c7312969
|
@ -2,7 +2,6 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { Icon, commentContent, external } from '@wordpress/icons';
|
import { Icon, commentContent, external } from '@wordpress/icons';
|
||||||
import { useEffect, useState } from '@wordpress/element';
|
import { useEffect, useState } from '@wordpress/element';
|
||||||
|
|
||||||
|
@ -10,7 +9,11 @@ import { useEffect, useState } from '@wordpress/element';
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
interface FeedbackPromptProps {
|
||||||
|
text: string;
|
||||||
|
title?: string;
|
||||||
|
url?: string;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Component to render a Feedback prompt in the sidebar.
|
* Component to render a Feedback prompt in the sidebar.
|
||||||
*
|
*
|
||||||
|
@ -23,7 +26,7 @@ const FeedbackPrompt = ( {
|
||||||
text,
|
text,
|
||||||
title = __( 'Feedback?', 'woo-gutenberg-products-block' ),
|
title = __( 'Feedback?', 'woo-gutenberg-products-block' ),
|
||||||
url = 'https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565',
|
url = 'https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565',
|
||||||
} ) => {
|
}: FeedbackPromptProps ) => {
|
||||||
// By returning false we ensure that this component is not entered into the InspectorControls
|
// By returning false we ensure that this component is not entered into the InspectorControls
|
||||||
// (which is a slot fill), children array on first render, on the second render when the state
|
// (which is a slot fill), children array on first render, on the second render when the state
|
||||||
// gets updated this component does get put into the InspectorControls children array but as the
|
// gets updated this component does get put into the InspectorControls children array but as the
|
||||||
|
@ -34,10 +37,13 @@ const FeedbackPrompt = ( {
|
||||||
}, [] );
|
}, [] );
|
||||||
|
|
||||||
return (
|
return (
|
||||||
isVisible && (
|
<>
|
||||||
|
{ isVisible && (
|
||||||
<div className="wc-block-feedback-prompt">
|
<div className="wc-block-feedback-prompt">
|
||||||
<Icon icon={ commentContent } />
|
<Icon icon={ commentContent } />
|
||||||
<h2 className="wc-block-feedback-prompt__title">{ title }</h2>
|
<h2 className="wc-block-feedback-prompt__title">
|
||||||
|
{ title }
|
||||||
|
</h2>
|
||||||
<p className="wc-block-feedback-prompt__text">{ text }</p>
|
<p className="wc-block-feedback-prompt__text">{ text }</p>
|
||||||
<a
|
<a
|
||||||
href={ url }
|
href={ url }
|
||||||
|
@ -52,15 +58,11 @@ const FeedbackPrompt = ( {
|
||||||
<Icon icon={ external } size={ 16 } />
|
<Icon icon={ external } size={ 16 } />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
)
|
) }
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
FeedbackPrompt.propTypes = {
|
|
||||||
text: PropTypes.string,
|
|
||||||
url: PropTypes.string,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default FeedbackPrompt;
|
export default FeedbackPrompt;
|
||||||
|
|
||||||
export const CartCheckoutFeedbackPrompt = () => (
|
export const CartCheckoutFeedbackPrompt = () => (
|
Loading…
Reference in New Issue