added api, validation and protected routing

This commit is contained in:
kuwsh1n
2024-03-18 19:04:41 +03:00
parent 7b1dab7002
commit 6817f5bf9b
13 changed files with 309 additions and 91 deletions

View File

@ -4,7 +4,13 @@ import classes from "../assets/styles/components/myInput.module.scss"
const MyInput = (props) => {
return (
<div className={classes.main} style={{...props.otherMainStyle}}>
<input type={props.type} placeholder={props.placeholder} style={{...props.otherInputStyle}} onChange={(e) => props.change(e.target.value)} value={props.value}/>
<input
type={props.type}
placeholder={props.placeholder}
style={{...props.otherInputStyle}}
onChange={(e) => props.change(e.target.value)}
value={props.value}
/>
</div>
)
}

View File

@ -6,12 +6,12 @@ const NavBar = ({navigate, auth, setAuth}) => {
<div className={classes.main}>
<div className={classes.wrapper}>
<div className={classes.menu}>
{auth ?
<div className={classes.menu__authorized}>
<span onClick={() => navigate("/")}>Главная</span>
<span onClick={() => navigate("/forms")}>Мои формы</span>
</div> :
<div></div>}
{auth ?
<span onClick={() => navigate("/forms")}>Мои формы</span> :
<span></span>}
</div>
</div>
<div className={classes.profile}>
{auth ?