{premiumPromoEnabled ? (
@@ -292,7 +290,6 @@ export const App = observer(() => {
>
)}
-
>
diff --git a/src/popup/components/Authentication/Authentication.tsx b/src/popup/components/Authentication/Authentication.tsx
index f1747292b..13c63fa61 100644
--- a/src/popup/components/Authentication/Authentication.tsx
+++ b/src/popup/components/Authentication/Authentication.tsx
@@ -10,6 +10,7 @@ import { TwoFactorForm } from './TwoFactorForm';
import { BackButton } from './BackButton';
import { PolicyAgreement } from './PolicyAgreement';
import { ScreenShot } from './ScreenShot';
+import { ConfirmEmail } from './ConfirmEmail';
import './auth.pcss';
@@ -23,6 +24,7 @@ export const Authentication = observer(() => {
signIn:
,
registration:
,
twoFactor:
,
+ confirmEmail:
,
};
return titleMaps[step] || titleMaps.authorization;
};
@@ -47,6 +49,9 @@ export const Authentication = observer(() => {
case authStore.STEPS.POLICY_AGREEMENT: {
return
;
}
+ case authStore.STEPS.CONFIRM_EMAIL: {
+ return
;
+ }
default: {
return
;
}
diff --git a/src/popup/components/Authentication/Authorization/authorization.pcss b/src/popup/components/Authentication/Authorization/authorization.pcss
index c95d20fdd..48cb72a26 100644
--- a/src/popup/components/Authentication/Authorization/authorization.pcss
+++ b/src/popup/components/Authentication/Authorization/authorization.pcss
@@ -1,7 +1,8 @@
.authorization {
&__title {
- font-size: 2.4rem;
- font-weight: 500;
+ font-size: 24px;
+ font-weight: 700;
+ line-height: 30px;
margin-bottom: 6px;
text-align: center;
}
@@ -42,6 +43,6 @@
width: 80px;
height: 2px;
background-color: var(--grayd8);
- margin: 0 auto 30px;
+ margin: 6px auto 30px;
}
}
diff --git a/src/popup/components/Authentication/BackButton.tsx b/src/popup/components/Authentication/BackButton.tsx
index 88bc4cc5a..245121336 100644
--- a/src/popup/components/Authentication/BackButton.tsx
+++ b/src/popup/components/Authentication/BackButton.tsx
@@ -5,9 +5,24 @@ import { rootStore } from '../../stores';
export const BackButton = () => {
const { authStore } = useContext(rootStore);
+ const { prevSteps } = authStore;
+
const handleBackClick = async () => {
await authStore.resetPasswords();
- await authStore.showAuthorizationScreen();
+ await authStore.resetCode();
+
+ if (prevSteps.length === 0) {
+ await authStore.showAuthorizationScreen();
+ }
+
+ const prevStep = prevSteps.pop();
+ if (!prevStep) {
+ await authStore.showAuthorizationScreen();
+ return;
+ }
+
+ authStore.resetRequestProcessionState();
+ authStore.switchStep(prevStep);
};
return (
diff --git a/src/popup/components/Authentication/ConfirmEmail/ConfirmEmail.tsx b/src/popup/components/Authentication/ConfirmEmail/ConfirmEmail.tsx
new file mode 100644
index 000000000..0982e2b25
--- /dev/null
+++ b/src/popup/components/Authentication/ConfirmEmail/ConfirmEmail.tsx
@@ -0,0 +1,109 @@
+import React, { useContext } from 'react';
+import { observer } from 'mobx-react';
+import ReactHtmlParser from 'react-html-parser';
+
+import classnames from 'classnames';
+
+import { translator } from '../../../../common/translator';
+import { reactTranslator } from '../../../../common/reactTranslator';
+import { rootStore } from '../../../stores';
+import { RequestStatus } from '../../../stores/constants';
+import { Submit } from '../Submit';
+import { InputField } from '../InputField';
+
+export const ConfirmEmail = observer(() => {
+ const { authStore } = useContext(rootStore);
+ const {
+ resendEmailConfirmationCode,
+ resendCodeCountdown,
+ requestProcessState,
+ credentials,
+ } = authStore;
+
+ const { code } = credentials;
+
+ const submitHandler = async (e: React.FormEvent
) => {
+ e.preventDefault();
+ await authStore.authenticate();
+ };
+
+ const inputChangeHandler = async (event: React.ChangeEvent) => {
+ const { target: { name, value } } = event;
+ await authStore.onCredentialsChange(name, value);
+ };
+
+ const resendCode = () => {
+ resendEmailConfirmationCode();
+ };
+
+ const formClassName = classnames(
+ 'form form--confirm-email',
+ { 'form--error': authStore.error },
+ );
+
+ return (
+
+ );
+});
diff --git a/src/popup/components/Authentication/ConfirmEmail/index.ts b/src/popup/components/Authentication/ConfirmEmail/index.ts
new file mode 100644
index 000000000..91ffc7dc7
--- /dev/null
+++ b/src/popup/components/Authentication/ConfirmEmail/index.ts
@@ -0,0 +1 @@
+export { ConfirmEmail } from './ConfirmEmail';
diff --git a/src/popup/components/Authentication/EmailAuth/EmailAuth.tsx b/src/popup/components/Authentication/EmailAuth/EmailAuth.tsx
index 966637384..330d66659 100644
--- a/src/popup/components/Authentication/EmailAuth/EmailAuth.tsx
+++ b/src/popup/components/Authentication/EmailAuth/EmailAuth.tsx
@@ -5,7 +5,7 @@ import ReactHtmlParser from 'react-html-parser';
import classnames from 'classnames';
import { rootStore } from '../../../stores';
-import { RequestStatus } from '../../../stores/consts';
+import { RequestStatus } from '../../../stores/constants';
import { Submit } from '../Submit';
import { InputField } from '../InputField';
import { translator } from '../../../../common/translator';
@@ -45,22 +45,20 @@ export const EmailAuth = observer(() => {
onSubmit={submitHandler}
>
-
-
- {authStore.error && (
-
- {ReactHtmlParser(authStore.error)}
-
- )}
-
+
+ {authStore.error && (
+
+ {ReactHtmlParser(authStore.error)}
+
+ )}
{getSubmitButton()}
diff --git a/src/popup/components/Authentication/InputField.tsx b/src/popup/components/Authentication/InputField.tsx
index b234bfd83..b12cb1772 100644
--- a/src/popup/components/Authentication/InputField.tsx
+++ b/src/popup/components/Authentication/InputField.tsx
@@ -12,6 +12,8 @@ interface InputFieldParameters {
placeholder?: string;
label?: string;
disabled?: boolean;
+ title?: string;
+ autocomplete?: string;
}
export const InputField = ({
@@ -24,6 +26,8 @@ export const InputField = ({
placeholder = '',
label = '',
disabled = false,
+ title = '',
+ autocomplete,
}: InputFieldParameters) => {
const inputClassName = classnames(
`form__input ${className}`,
@@ -43,10 +47,12 @@ export const InputField = ({
type={type}
onChange={inputChangeHandler}
defaultValue={value}
+ title={title}
placeholder={placeholder}
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
disabled={disabled}
+ autoComplete={autocomplete}
/>
diff --git a/src/popup/components/Authentication/RegistrationForm/RegistrationForm.tsx b/src/popup/components/Authentication/RegistrationForm/RegistrationForm.tsx
index 3a47b3f7d..549d55e0c 100644
--- a/src/popup/components/Authentication/RegistrationForm/RegistrationForm.tsx
+++ b/src/popup/components/Authentication/RegistrationForm/RegistrationForm.tsx
@@ -5,7 +5,7 @@ import ReactHtmlParser from 'react-html-parser';
import classnames from 'classnames';
import { rootStore } from '../../../stores';
-import { RequestStatus, InputType } from '../../../stores/consts';
+import { RequestStatus, InputType } from '../../../stores/constants';
import PasswordField from '../PasswordField';
import { Submit } from '../Submit';
import { reactTranslator } from '../../../../common/reactTranslator';
@@ -71,6 +71,7 @@ export const RegistrationForm = observer(() => {
id="username"
type="email"
value={authStore.credentials.username}
+ title={authStore.credentials.username}
label={translator.getMessage('auth_sign_in_provider_adguard_label')}
className="form__input__email-disabled"
disabled
diff --git a/src/popup/components/Authentication/SignInForm/SignInForm.tsx b/src/popup/components/Authentication/SignInForm/SignInForm.tsx
index cffb5602f..cefb4be5c 100644
--- a/src/popup/components/Authentication/SignInForm/SignInForm.tsx
+++ b/src/popup/components/Authentication/SignInForm/SignInForm.tsx
@@ -6,7 +6,7 @@ import classnames from 'classnames';
import { popupActions } from '../../../actions/popupActions';
import { rootStore } from '../../../stores';
-import { RequestStatus, InputType } from '../../../stores/consts';
+import { RequestStatus, InputType } from '../../../stores/constants';
import PasswordField from '../PasswordField';
import { Submit } from '../Submit';
import { reactTranslator } from '../../../../common/reactTranslator';
@@ -56,7 +56,10 @@ export const SignInForm = observer(() => {
reactTranslator.getMessage('auth_header_sing_in_notice', {
username: authStore.credentials.username,
span: (chunks: string) => (
-