Add enable cookies field
[MAILPOET-2708]
This commit is contained in:
committed by
Veljko V
parent
0109477597
commit
eb8f9ccd2f
27
assets/js/src/settings/pages/woo_commerce/enable_cookies.tsx
Normal file
27
assets/js/src/settings/pages/woo_commerce/enable_cookies.tsx
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { t, onToggle } from 'common/functions';
|
||||||
|
import { useSetting } from 'settings/store/hooks';
|
||||||
|
import { Label, Inputs } from 'settings/components';
|
||||||
|
|
||||||
|
export default function EnableCookies() {
|
||||||
|
const [enabled, setEnabled] = useSetting('woocommerce', 'accept_cookie_revenue_tracking', 'enabled');
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Label
|
||||||
|
title={t('enableCookiesTitle')}
|
||||||
|
description={t('enableCookiesDescription')}
|
||||||
|
htmlFor="mailpoet_accept_cookie_revenue_tracking"
|
||||||
|
/>
|
||||||
|
<Inputs>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
id="mailpoet_accept_cookie_revenue_tracking"
|
||||||
|
data-automation-id="accept_cookie_revenue_tracking"
|
||||||
|
checked={enabled === '1'}
|
||||||
|
onChange={onToggle(setEnabled, '')}
|
||||||
|
/>
|
||||||
|
</Inputs>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
@ -3,6 +3,7 @@ import { SaveButton } from 'settings/components';
|
|||||||
import EmailCustomizer from './email_customizer';
|
import EmailCustomizer from './email_customizer';
|
||||||
import CheckoutOptin from './checkout_optin';
|
import CheckoutOptin from './checkout_optin';
|
||||||
import SubscribeOldCustomers from './subscribe_old_customers';
|
import SubscribeOldCustomers from './subscribe_old_customers';
|
||||||
|
import EnableCookies from './enable_cookies';
|
||||||
|
|
||||||
export default function WooCommerce() {
|
export default function WooCommerce() {
|
||||||
return (
|
return (
|
||||||
@ -10,6 +11,7 @@ export default function WooCommerce() {
|
|||||||
<EmailCustomizer />
|
<EmailCustomizer />
|
||||||
<CheckoutOptin />
|
<CheckoutOptin />
|
||||||
<SubscribeOldCustomers />
|
<SubscribeOldCustomers />
|
||||||
|
<EnableCookies />
|
||||||
<SaveButton />
|
<SaveButton />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user