Skip to content

Commit

Permalink
Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
whooaami committed Oct 18, 2023
1 parent 5e17301 commit c991cc2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@ import { ResendActivationFormContentComponent } from './signup-form/ResendActiva
import { useState } from 'react';
import { Link } from 'react-router-dom';


export function ResendActivationFormComponent() {
const [isValid, setIsValid] = useState(false);

const updateIsValid = (value) => {
setIsValid(value);
};
return (
<div className={styles['form__container']}>
<div className={styles['form__header']}>Надіслати лист для активації ще раз</div>
<div className={styles['form__header']}>
Надіслати лист для активації ще раз
</div>
<div className={styles['form__footer']}>
<p>
Введіть електронну адресу вказану при реєстрації для повторного надіслення листа. <br />
На зазначену Вами електронну пошту буде відправлено листа з посиланням для активації. <br />
Введіть електронну адресу вказану при реєстрації для повторного
надіслення листа. <br />
На зазначену Вами електронну пошту буде відправлено листа з посиланням
для активації. <br />
</p>
</div>
<ResendActivationFormContentComponent setIsValid={setIsValid}/>
<ResendActivationFormContentComponent setIsValid={updateIsValid} />
<div className={styles['form__footer']}>
<div className={styles['button-container']}>
<Link className={styles['signup-page__button']} to="/sign-up">
Expand All @@ -24,7 +31,11 @@ export function ResendActivationFormComponent() {
<button
disabled={!isValid}
form="signUpForm"
className={isValid ? styles['resend-activation__button'] : styles['resend-activation__button__disabled']}
className={
isValid
? styles['resend-activation__button']
: styles['resend-activation__button__disabled']
}
type="submit"
>
Надіслати
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useEffect } from 'react';
import { useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';

import axios from 'axios';
import styles from './ResendActivationFormContent.module.css';

export function ResendActivationFormContentComponent(props) {
export function ResendActivationFormContentComponent({ setIsValid }) {
const navigate = useNavigate();

const errorMessageTemplates = {
Expand All @@ -24,8 +24,6 @@ export function ResendActivationFormContentComponent(props) {
mode: 'all',
});

const { setIsValid } = props;

useEffect(() => {
const formIsValid = isValid;
setIsValid(formIsValid);
Expand All @@ -40,10 +38,13 @@ export function ResendActivationFormContentComponent(props) {
method: 'post',
url: `${process.env.REACT_APP_BASE_API_URL}/api/auth/users/resend_activation/`,
withCredentials: false,
data: dataToSend
}).then(res => console.log(res.data)).catch(error => console.log(error));
console.log(process.env.REACT_APP_BASE_API_URL);
navigate('/login');
data: dataToSend,
})
.then(() => {
setIsValid(true);
navigate('/login');
})
.catch((error) => console.log(error));
};

return (
Expand All @@ -58,7 +59,9 @@ export function ResendActivationFormContentComponent(props) {
<div className={styles['resend-activation-form__row']}>
<div className={styles['resend-activation-form__column']}>
<div className={styles['resend-activation-form__label']}>
<label className={styles['resend-activation-form__label--required']}>
<label
className={styles['resend-activation-form__label--required']}
>
*
</label>
<label className={styles['resend-activation-form__label--text']}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.modal {
position: absolute; /* or fixed */
position: absolute;
top: 50%;
left: 52%;
transform: translate(-50%, -50%);
Expand Down Expand Up @@ -28,18 +28,15 @@
align-self: stretch;
background: var(--main-white, #fff);

/* border & divider/divider ↓ */
box-shadow: 0px -1px 0px 0px #f0f0f0 inset;
color: var(--character-title-85, rgba(0, 0, 0, 0.85));
font-feature-settings: "calt" off;

/* Text/Body/16-Semi bold */
font-family: Inter, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: 600;
line-height: 20px;
/* 125% */
letter-spacing: -0.16px;
}

Expand All @@ -51,8 +48,6 @@
gap: 8px;
align-self: stretch;
background: var(--main-white, #fff);

/* border & divider/divider ↑ */
box-shadow: 0px 1px 0px 0px #f0f0f0 inset;
}

Expand All @@ -64,8 +59,6 @@
gap: 8px;
align-self: stretch;
background: var(--main-white, #fff);

/* border & divider/divider ↑ */
box-shadow: 0px 1px 0px 0px #f0f0f0 inset;
}

Expand All @@ -84,24 +77,19 @@
border-radius: 4px;
border: 1px solid var(--primary-green-80, #1f9a7c);
background: var(--main-white, #fff);

/* drop-shadow/button-secondary */
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);

color: var(--primary-green-80, #1f9a7c);
text-align: center;
font-feature-settings: "calt" off;

/* Text/Body/16-Semi bold */
font-family: Inter, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: 600;
line-height: 20px;
/* 125% */
letter-spacing: -0.16px;
text-decoration: none;

cursor: pointer;
}

Expand Down

0 comments on commit c991cc2

Please sign in to comment.