generated from Yandex-Practicum/architecture-sprint-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
609 additions
and
625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 34 additions & 33 deletions
67
frontend/microfrontend/auth_app/src/components/Register.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import {Link} from 'react-router-dom'; | ||
|
||
function Register ({onRegister}){ | ||
const [email, setEmail] = React.useState(''); | ||
const [password, setPassword] = React.useState(''); | ||
function Register({onRegister}) { | ||
const [email, setEmail] = React.useState(''); | ||
const [password, setPassword] = React.useState(''); | ||
|
||
function handleSubmit(e){ | ||
e.preventDefault(); | ||
const userData = { | ||
email, | ||
password | ||
function handleSubmit(e) { | ||
e.preventDefault(); | ||
const userData = { | ||
email, | ||
password | ||
} | ||
onRegister(userData); | ||
} | ||
onRegister(userData); | ||
} | ||
|
||
return ( | ||
<div className="auth-form"> | ||
<form className="auth-form__form" onSubmit={handleSubmit}> | ||
<div className="auth-form__wrapper"> | ||
<h3 className="auth-form__title">Регистрация</h3> | ||
<label className="auth-form__input"> | ||
<input type="text" name="email" id="email" | ||
className="auth-form__textfield" placeholder="Email" | ||
onChange={e => setEmail(e.target.value)} required /> | ||
</label> | ||
<label className="auth-form__input"> | ||
<input type="password" name="password" id="password" | ||
className="auth-form__textfield" placeholder="Пароль" | ||
onChange={e => setPassword(e.target.value)} required /> | ||
</label> | ||
return ( | ||
<div className="auth-form"> | ||
<form className="auth-form__form" onSubmit={handleSubmit}> | ||
<div className="auth-form__wrapper"> | ||
<h3 className="auth-form__title">Регистрация</h3> | ||
<label className="auth-form__input"> | ||
<input type="text" name="email" id="email" | ||
className="auth-form__textfield" placeholder="Email" | ||
onChange={e => setEmail(e.target.value)} required/> | ||
</label> | ||
<label className="auth-form__input"> | ||
<input type="password" name="password" id="password" | ||
className="auth-form__textfield" placeholder="Пароль" | ||
onChange={e => setPassword(e.target.value)} required/> | ||
</label> | ||
</div> | ||
<div className="auth-form__wrapper"> | ||
<button className="auth-form__button" type="submit">Зарегистрироваться</button> | ||
<p className="auth-form__text">Уже зарегистрированы? <Link className="auth-form__link" | ||
to="/signin">Войти</Link></p> | ||
</div> | ||
</form> | ||
</div> | ||
<div className="auth-form__wrapper"> | ||
<button className="auth-form__button" type="submit">Зарегистрироваться</button> | ||
<p className="auth-form__text">Уже зарегистрированы? <Link className="auth-form__link" to="/signin">Войти</Link></p> | ||
</div> | ||
</form> | ||
</div> | ||
) | ||
) | ||
} | ||
|
||
export default Register; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 34 additions & 34 deletions
68
frontend/microfrontend/mesto_app/src/components/AddPlacePopup.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
import React from 'react'; | ||
import PopupWithForm from './PopupWithForm'; | ||
|
||
function AddPlacePopup({ isOpen, onAddPlace, onClose }) { | ||
const [name, setName] = React.useState(''); | ||
const [link, setLink] = React.useState(''); | ||
function AddPlacePopup({isOpen, onAddPlace, onClose}) { | ||
const [name, setName] = React.useState(''); | ||
const [link, setLink] = React.useState(''); | ||
|
||
function handleNameChange(e) { | ||
setName(e.target.value); | ||
} | ||
function handleNameChange(e) { | ||
setName(e.target.value); | ||
} | ||
|
||
function handleLinkChange(e) { | ||
setLink(e.target.value); | ||
} | ||
function handleLinkChange(e) { | ||
setLink(e.target.value); | ||
} | ||
|
||
function handleSubmit(e) { | ||
e.preventDefault(); | ||
function handleSubmit(e) { | ||
e.preventDefault(); | ||
|
||
onAddPlace({ | ||
name, | ||
link | ||
}); | ||
} | ||
onAddPlace({ | ||
name, | ||
link | ||
}); | ||
} | ||
|
||
return ( | ||
<PopupWithForm | ||
isOpen={isOpen} onSubmit={handleSubmit} onClose={onClose} title="Новое место" name="new-card" | ||
> | ||
<label className="popup__label"> | ||
<input type="text" name="name" id="place-name" | ||
className="popup__input popup__input_type_card-name" placeholder="Название" | ||
required minLength="1" maxLength="30" value={name} onChange={handleNameChange} /> | ||
<span className="popup__error" id="place-name-error"></span> | ||
</label> | ||
<label className="popup__label"> | ||
<input type="url" name="link" id="place-link" | ||
className="popup__input popup__input_type_url" placeholder="Ссылка на картинку" | ||
required value={link} onChange={handleLinkChange} /> | ||
<span className="popup__error" id="place-link-error"></span> | ||
</label> | ||
</PopupWithForm> | ||
); | ||
return ( | ||
<PopupWithForm | ||
isOpen={isOpen} onSubmit={handleSubmit} onClose={onClose} title="Новое место" name="new-card" | ||
> | ||
<label className="popup__label"> | ||
<input type="text" name="name" id="place-name" | ||
className="popup__input popup__input_type_card-name" placeholder="Название" | ||
required minLength="1" maxLength="30" value={name} onChange={handleNameChange}/> | ||
<span className="popup__error" id="place-name-error"></span> | ||
</label> | ||
<label className="popup__label"> | ||
<input type="url" name="link" id="place-link" | ||
className="popup__input popup__input_type_url" placeholder="Ссылка на картинку" | ||
required value={link} onChange={handleLinkChange}/> | ||
<span className="popup__error" id="place-link-error"></span> | ||
</label> | ||
</PopupWithForm> | ||
); | ||
} | ||
|
||
export default AddPlacePopup; |
Oops, something went wrong.