Fix React warnings
[MAILPOET-2678]
This commit is contained in:
committed by
Veljko V
parent
b738ad3809
commit
eeefaa3a02
@@ -1,4 +1,6 @@
|
||||
import React from 'react';
|
||||
import React, { Fragment } from 'react';
|
||||
import ReactStringReplace from 'react-string-replace';
|
||||
|
||||
import { t, onChange } from 'common/functions';
|
||||
import { Label, Inputs } from 'settings/components';
|
||||
import { useSetting } from 'settings/store/hooks';
|
||||
@@ -8,15 +10,17 @@ export default function EmailContent() {
|
||||
const [body, setBody] = useSetting('signup_confirmation', 'body');
|
||||
|
||||
if (!enabled) return null;
|
||||
const descriptionLines = t('emailContentDescription').split('<br />').filter((x) => x);
|
||||
return (
|
||||
<>
|
||||
<Label
|
||||
title={t('emailContent')}
|
||||
description={t('emailContentDescription').split('<br />').map((line) => (
|
||||
<>
|
||||
description={descriptionLines.map((line) => (
|
||||
<span key={line}>
|
||||
{line}
|
||||
<br />
|
||||
</>
|
||||
<br />
|
||||
</span>
|
||||
))}
|
||||
htmlFor="signup_confirmation-body"
|
||||
/>
|
||||
|
@@ -1,20 +1,18 @@
|
||||
import React from 'react';
|
||||
import { t } from 'common/functions';
|
||||
import { t, onChange } from 'common/functions';
|
||||
import { Label, Inputs } from 'settings/components';
|
||||
import { useSelector, useSetting } from 'settings/store/hooks';
|
||||
|
||||
export default function EnableSignupConfirmation() {
|
||||
const isMssActive = useSelector('isMssActive')();
|
||||
const [enabled, setEnabled] = useSetting('signup_confirmation', 'enabled');
|
||||
const enable = () => {
|
||||
const handleChange = (value: '1' | '') => {
|
||||
// eslint-disable-next-line no-alert
|
||||
if (window.confirm(t('subscribersNeedToActivateSub'))) {
|
||||
if (value === '1' && window.confirm(t('subscribersNeedToActivateSub'))) {
|
||||
setEnabled('1');
|
||||
}
|
||||
};
|
||||
const disable = () => {
|
||||
// eslint-disable-next-line no-alert
|
||||
if (window.confirm(t('newSubscribersAutoConfirmed'))) {
|
||||
if (value === '' && window.confirm(t('newSubscribersAutoConfirmed'))) {
|
||||
setEnabled('');
|
||||
}
|
||||
};
|
||||
@@ -45,18 +43,18 @@ export default function EnableSignupConfirmation() {
|
||||
<input
|
||||
id="signup_confirmation-enabled"
|
||||
type="radio"
|
||||
defaultChecked={enabled === '1'}
|
||||
checked={enabled === '1'}
|
||||
value="1"
|
||||
onClick={enable}
|
||||
onChange={onChange(handleChange)}
|
||||
data-automation-id="enable_signup_confirmation"
|
||||
/>
|
||||
{t('yes')}
|
||||
{' '}
|
||||
<input
|
||||
type="radio"
|
||||
defaultChecked={enabled === ''}
|
||||
checked={enabled === ''}
|
||||
value=""
|
||||
onClick={disable}
|
||||
onChange={onChange(handleChange)}
|
||||
data-automation-id="disable_signup_confirmation"
|
||||
/>
|
||||
{t('no')}
|
||||
|
Reference in New Issue
Block a user