Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#436 [Reset Password] Fix UI defects #440

Merged
merged 7 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from 'react-router-dom';
import css from './ShortFooter.module.css';

const LINKS = [
Expand Down Expand Up @@ -34,7 +35,7 @@ function ShortFooter() {
<div className={css['footer-info__text']}>Copyright 2022 Company name.</div>
<div className={css['footer-links']}>
{LINKS.map( (element) => (
<a className={css['footer-link__text']} key={element.id} href={element.link}>{element.title}</a>
<Link className={css['footer-link__text']} key={element.id} to={element.link}>{element.title}</Link>
))}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from 'react-router-dom';
import css from './Footer.module.css';
import logo from './logo.svg';

Expand Down Expand Up @@ -35,7 +36,7 @@ function Footer() {
<div className={css['footer-info__text']}>Copyright 2022 Company name.</div>
<div className={css['footer-links']}>
{LINKS.map( (element) => (
<a className={css['footer-link__text']} key={element.id} href={element.link}>{element.title}</a>
<Link className={css['footer-link__text']} key={element.id} to={element.link}>{element.title}</Link>
))}
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions FrontEnd/src/components/PrivacyPolicyPage/UI/header/Menu.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from 'react-router-dom';
import css from './Menu.module.css';

const MENU = [
Expand Down Expand Up @@ -28,9 +29,9 @@ function Menu() {
<div className={css['header-menu-section']}>
{MENU.map((element) => (
<div key={element.id} className={css['header-menu-element']}>
<a className={css['header-menu-element__text']} key={element.id} href={element.link}>
<Link className={css['header-menu-element__text']} key={element.id} to={element.link}>
{element.title}
</a>
</Link>
</div>
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from 'react-router-dom';
import css from './Profile.module.css';
import avatar_image from './Avatar.png';

Expand All @@ -6,7 +7,7 @@ function Profile() {
<div className={css['header-profile-section']}>
<img className={css['header-profile__avatar']} src={avatar_image} alt=""/>
<div className={css['header-profile-tab']}>
<a href="profile">Профіль</a>
<Link to="profile">Профіль</Link>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { PropTypes } from 'prop-types';
import PhoneEmail from './PhoneEmail';
import classes from './DataContacts.module.css';
Expand Down Expand Up @@ -62,9 +63,9 @@ function DataContacts ({ data }) {
{value.map((contact, index) => {
if (contact.url) {
return (
<a key={index} href={contact.url}>
<Link key={index} to={contact.url}>
{contact.svgPath}
</a>
</Link>
);
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function SendEmailRestorePasswordFormContentComponent({ setIsValid }) {

const errorMessageTemplates = {
required: 'Обов’язкове поле',
email: 'Email не відповідає вимогам',
email: 'Формат електронної адреси некоректний',
};

const {
Expand Down Expand Up @@ -46,7 +46,7 @@ export function SendEmailRestorePasswordFormContentComponent({ setIsValid }) {
navigate('/reset-password/modal');
})
.catch(() => {
toast.error('Формат електронної пошти некоректний.');
toast.error('Зазначена електронна адреса не зареєстрована.');
});
};

Expand All @@ -62,9 +62,6 @@ export function SendEmailRestorePasswordFormContentComponent({ setIsValid }) {
<div className={styles['send-email-form__row']}>
<div className={styles['send-email-form__column']}>
<div className={styles['send-email-form__label']}>
<label className={styles['send-email-form__label--required']}>
*
</label>
<label className={styles['send-email-form__label--text']}>
Електронна пошта
</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,28 @@
gap: 10px;
align-self: stretch;
}

.send-email-form__container {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
}

.send-email-form__row {
display: flex;
align-items: flex-start;
gap: 8px;
}

.send-email-form__column {
display: flex;
width: 257px;
height: 84px;
padding-bottom: 0px;
flex-direction: column;
align-items: flex-start;
}

.send-email-form__label {
display: flex;
gap: 4px;
Expand All @@ -37,33 +36,22 @@
color: var(--main-black-90, #292e32);
font-feature-settings: "calt" off;

/* Text/Body/14-Regular */
font-family: Inter, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px; /* 142.857% */
line-height: 20px;
letter-spacing: -0.14px;
text-align: left;
}

.send-email-form__label--required {
color: var(--dust-red-5, #ff4d4f);
text-align: right;
font-family: SimSong;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 22.001px;
}


.send-email-form__label--text {
display: flex;
flex-direction: column;
justify-content: center;
flex: 1 0 0;
}

.send-email-form__field {
display: flex;
width: 520px;
Expand All @@ -72,7 +60,7 @@
border-radius: 2px;
background: var(--main-white, #fff);
}

.send-email-form__input {
display: flex;
height: 22px;
Expand All @@ -85,30 +73,27 @@
background: var(--main-white, #fff);
color: var(--character-title-85, rgba(0, 0, 0, 0.85));

/* Body/regular */
font-family: Roboto, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 22px;
}

.send-email-form__input:focus {
outline: none;
}

.send-email-form__error {
display: flex;
padding: 1px 0px;
align-items: flex-start;
gap: 10px;
align-self: stretch;
color: var(--red-red-100, #f34444);

/* Body/regular */
font-family: Roboto, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 22px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function RestorePasswordFormContentComponent({ setIsValid }) {
handleSubmit,
getValues,
formState: { errors, isValid },
} = useForm();
} = useForm({mode: 'all'});

useEffect(() => {
const formIsValid = isValid;
Expand Down Expand Up @@ -123,7 +123,7 @@ export function RestorePasswordFormContentComponent({ setIsValid }) {
</label>
<div className={styles['reset-password-form__label--password']}>
<label className={styles['reset-password-form__label--text']}>
Повторіть пароль
Повторіть новий пароль
</label>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from 'react-router-dom';
import styles from './RestorePasswordPage.module.css';
import DotDecorComponent from '../UI/dotDecor/DotDecor';
import { RestorePasswordFormComponent } from '../components/restorepassword/RestorePasswordForm';
Expand All @@ -13,9 +14,9 @@ export function RestorePasswordPage() {
<div className={styles['sign-in-line__text']}>
Вже були на нашому сайті?
</div>
<a href="/login" className={styles['sign-in-line__link']}>
<Link to="/login" className={styles['sign-in-line__link']}>
Увійти
</a>
</Link>
</div>
</div>
<DotDecorComponent position={'down-left'} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from 'react-router-dom';
import styles from './SendEmailRestorePassword.module.css';
import DotDecorComponent from '../UI/dotDecor/DotDecor';
import { SendEmailRestorePasswordFormComponent } from '../components/restorepassword/SendEmailForm';
Expand All @@ -13,9 +14,9 @@ export function SendEmailRestorePasswordPage() {
<div className={styles['sign-in-line__text']}>
Вже були на нашому сайті?
</div>
<a href="/login" className={styles['sign-in-line__link']}>
<Link to="/login" className={styles['sign-in-line__link']}>
Увійти
</a>
</Link>
</div>
</div>
<DotDecorComponent position={'down-left'} />
Expand Down
5 changes: 3 additions & 2 deletions FrontEnd/src/components/SignUp/pages/ResendActivationPage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from 'react-router-dom';
import styles from './SignUpPage.module.css';
import DotDecorComponent from '../UI/dotDecor/DotDecor';
import { ResendActivationFormComponent } from '../components/signup/ResendActivationForm';
Expand All @@ -13,9 +14,9 @@ export function ResendActivationPage() {
<div className={styles['sign-in-line__text']}>
Вже були на нашому сайті?
</div>
<a href="/login" className={styles['sign-in-line__link']}>
<Link to="/login" className={styles['sign-in-line__link']}>
Увійти
</a>
</Link>
</div>
</div>
<DotDecorComponent position={'down-left'} />
Expand Down
4 changes: 2 additions & 2 deletions FrontEnd/src/components/SignUp/pages/SignUpModalPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export function SignUpModalPage() {
Будь ласка перейдіть за посиланням з листа для підтвердження вказаної електронної адреси. <br />
На цьому реєстрацію завершено. <br />
<div className={styles['resend-line']}>
<a href="/sign-up/resend-activation" className={styles['resend-line__link']}>
<Link to="/sign-up/resend-activation" className={styles['resend-line__link']}>
Не отримали лист?
</a>
</Link>
</div>
</p>
</div>
Expand Down
5 changes: 3 additions & 2 deletions FrontEnd/src/components/SignUp/pages/SignUpPage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from 'react-router-dom';
import styles from './SignUpPage.module.css';
import DotDecorComponent from '../UI/dotDecor/DotDecor';
import { SignUpFormComponent } from '../components/signup/SignUpForm';
Expand All @@ -13,9 +14,9 @@ export function SignUpPage() {
<div className={styles['sign-in-line__text']}>
Вже були на нашому сайті?
</div>
<a href="/login" className={styles['sign-in-line__link']}>
<Link to="/login" className={styles['sign-in-line__link']}>
Увійти
</a>
</Link>
</div>
</div>
<DotDecorComponent position={'down-left'} />
Expand Down
8 changes: 4 additions & 4 deletions FrontEnd/src/components/authorization/LoginPage.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useForm } from 'react-hook-form';
import { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { useNavigate, Link } from 'react-router-dom';
import axios from 'axios';
import validator from 'validator';
import EyeVisible from './EyeVisible';
Expand Down Expand Up @@ -150,20 +150,20 @@ const LoginContent = (props) => {
{errors.unspecifiedError && errors.unspecifiedError.message}
</span>
</div>
<a href="/reset-password" className={classes['forget-password']}>Забули пароль?</a>
<Link to="/reset-password" className={classes['forget-password']}>Забули пароль?</Link>
</div>

</div>
<div className={classes['login-footer']}>
<div className={classes['login-footer-buttons']}>
<a href="/">
<Link to="/">
<button
type="button"
className={classes['login-footer-buttons__main']}
>
Головна
</button>
</a>
</Link>
<button
disabled={!isValid}
type="submit"
Expand Down
3 changes: 2 additions & 1 deletion FrontEnd/src/components/authorization/SignUpInvitation.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Link } from 'react-router-dom';
import classes from './SignUpInvitation.module.css';

const SignUpInvitation = () => {
return (
<div className={classes['signup-invitation']}>
<p>Вперше на нашому сайті?</p>
<a href="/sign-up">Зареєструйтесь</a>
<Link to="/sign-up">Зареєструйтесь</Link>
</div>
);
};
Expand Down
3 changes: 2 additions & 1 deletion FrontEnd/src/components/errorPages/ErrorPage404.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from 'react-router-dom';
import css from './ErrorPage404.module.css';
import { Button } from 'antd';

Expand All @@ -15,7 +16,7 @@ export default function ErrorPage404() {
</p>
</div>
<Button>
<a className={css['button-text']} href="/">Повернутися на Головну</a>
<Link className={css['button-text']} to="/">Повернутися на Головну</Link>
</Button>
</div>
</div>
Expand Down
6 changes: 0 additions & 6 deletions FrontEnd/src/context/AuthContextProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ export function AuthProvider ({ children }) {
}
);

if (authToken) {
login(authToken);
} else {
logout();
}

setLoading(false);
}, []);

Expand Down
Loading