2019-12-16 14:59:16 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
import PropTypes from 'prop-types';
|
2020-01-31 18:20:33 +00:00
|
|
|
import { Icon, comment, external } from '@woocommerce/icons';
|
2019-12-16 14:59:16 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import './style.scss';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component to render a Feedback prompt in the sidebar.
|
|
|
|
*/
|
2020-08-09 20:18:36 +00:00
|
|
|
const FeedbackPrompt = ( {
|
|
|
|
text,
|
|
|
|
url = 'https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565',
|
|
|
|
} ) => {
|
2019-12-16 14:59:16 +00:00
|
|
|
return (
|
|
|
|
<div className="wc-block-feedback-prompt">
|
2020-01-31 18:20:33 +00:00
|
|
|
<Icon srcElement={ comment } />
|
2019-12-16 14:59:16 +00:00
|
|
|
<h2 className="wc-block-feedback-prompt__title">
|
|
|
|
{ __( 'Feedback?', 'woo-gutenberg-products-block' ) }
|
|
|
|
</h2>
|
|
|
|
<p className="wc-block-feedback-prompt__text">{ text }</p>
|
|
|
|
<a
|
2020-08-09 20:18:36 +00:00
|
|
|
href={ url }
|
2019-12-16 14:59:16 +00:00
|
|
|
className="wc-block-feedback-prompt__link"
|
|
|
|
rel="noreferrer noopener"
|
|
|
|
target="_blank"
|
|
|
|
>
|
|
|
|
{ __(
|
|
|
|
'Give us your feedback.',
|
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
) }
|
2020-01-31 18:20:33 +00:00
|
|
|
<Icon srcElement={ external } size={ 16 } />
|
2019-12-16 14:59:16 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
FeedbackPrompt.propTypes = {
|
|
|
|
text: PropTypes.string,
|
2020-08-09 20:18:36 +00:00
|
|
|
url: PropTypes.string,
|
2019-12-16 14:59:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default FeedbackPrompt;
|
2020-08-09 20:18:36 +00:00
|
|
|
|
|
|
|
export const CartCheckoutFeedbackPrompt = () => (
|
|
|
|
<FeedbackPrompt
|
|
|
|
text={ __(
|
|
|
|
'We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.',
|
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
) }
|
|
|
|
url="https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?template=--cart-checkout-feedback.md"
|
|
|
|
/>
|
|
|
|
);
|