Add tracking field

[MAILPOET-2680]
This commit is contained in:
Amine Ben hammou
2020-03-19 21:10:30 +01:00
committed by Veljko V
parent e66b0c7f9a
commit 1c596e2e73
2 changed files with 44 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import React from 'react';
import BounceAddress from './bounce_address';
import TaskScheduler from './task_scheduler';
import Roles from './roles';
import Tracking from './tracking';
export default function Advanced() {
return (
@@ -9,6 +10,7 @@ export default function Advanced() {
<BounceAddress />
<TaskScheduler />
<Roles />
<Tracking />
</div>
);
}

View File

@@ -0,0 +1,42 @@
import React from 'react';
import { t, onChange } from 'common/functions';
import { useSetting } from 'settings/store/hooks';
import { Label, Inputs } from 'settings/components';
export default function Tracking() {
const [enabled, setEnabled] = useSetting('tracking', 'enabled');
return (
<>
<Label
title={t('trackingTitle')}
description={t('trackingDescription')}
htmlFor=""
/>
<Inputs>
<input
type="radio"
id="tracking-enabled"
value="1"
checked={enabled === '1'}
onChange={onChange(setEnabled)}
/>
<label htmlFor="tracking-enabled">
{t('yes')}
</label>
{' '}
<input
type="radio"
id="tracking-disabled"
value=""
checked={enabled === ''}
onChange={onChange(setEnabled)}
/>
<label htmlFor="tracking-disabled">
{t('no')}
</label>
</Inputs>
</>
);
}