2020-06-16 02:30:41 +00:00
|
|
|
/**
|
2020-08-13 02:05:22 +00:00
|
|
|
* External dependencies
|
2020-06-16 02:30:41 +00:00
|
|
|
*/
|
|
|
|
import { __ } from '@wordpress/i18n';
|
2022-02-08 22:22:26 +00:00
|
|
|
import { useUser } from '@woocommerce/data';
|
2020-06-16 02:30:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import './style.scss';
|
|
|
|
import RecommendedExtensions from '../components/recommended-extensions';
|
|
|
|
import KnowledgeBase from '../components/knowledge-base';
|
2022-01-06 12:53:30 +00:00
|
|
|
import { getAdminSetting } from '~/utils/admin-settings';
|
2020-06-16 02:30:41 +00:00
|
|
|
import '../data';
|
|
|
|
|
|
|
|
const CouponsOverview = () => {
|
2022-02-08 22:22:26 +00:00
|
|
|
const { currentUserCan } = useUser();
|
|
|
|
|
|
|
|
const shouldShowExtensions =
|
|
|
|
getAdminSetting( 'allowMarketplaceSuggestions', false ) &&
|
|
|
|
currentUserCan( 'install_plugins' );
|
2020-06-16 02:30:41 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="woocommerce-marketing-coupons">
|
2022-02-08 22:22:26 +00:00
|
|
|
{ shouldShowExtensions && (
|
2020-06-16 02:30:41 +00:00
|
|
|
<RecommendedExtensions
|
2020-07-28 02:32:58 +00:00
|
|
|
title={ __(
|
|
|
|
'Recommended coupon extensions',
|
2022-03-30 09:00:04 +00:00
|
|
|
'woocommerce'
|
2020-07-28 02:32:58 +00:00
|
|
|
) }
|
|
|
|
description={ __(
|
|
|
|
'Take your coupon marketing to the next level with our recommended coupon extensions.',
|
2022-03-30 09:00:04 +00:00
|
|
|
'woocommerce'
|
2020-07-28 02:32:58 +00:00
|
|
|
) }
|
2020-06-16 02:30:41 +00:00
|
|
|
category="coupons"
|
|
|
|
/>
|
|
|
|
) }
|
|
|
|
<KnowledgeBase
|
|
|
|
category="coupons"
|
2020-07-28 02:32:58 +00:00
|
|
|
description={ __(
|
|
|
|
'Learn the ins and outs of successful coupon marketing from the experts at WooCommerce.',
|
2022-03-30 09:00:04 +00:00
|
|
|
'woocommerce'
|
2020-07-28 02:32:58 +00:00
|
|
|
) }
|
2020-06-16 02:30:41 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default CouponsOverview;
|