Added authorization

This commit is contained in:
2020-11-29 09:12:02 +05:00
parent 7066d0f233
commit a0dbd1eca8
10 changed files with 44 additions and 22 deletions

View File

@ -54,7 +54,7 @@ const Login: React.FC = () => {
return (
<form onSubmit={handleSubmit(resetError, setUserState, gotError, router)}>
<input type="email" name="email" id="email" />
<input type="username" name="username" id="username" />
<input type="password" name="password" id="password" autoComplete="on" />
<input type="submit" />
{error.has ? <ErrorMessage message={error.message} /> : ""}

View File

@ -1,15 +1,12 @@
import React from "react";
import { IRouteCard } from "types/user";
import { formatTimeLength } from "utils";
const RouteCard: React.FC<IRouteCard> = ({ route }) => {
return (
<div>
<h2>{route.name}</h2>
<p>
Данный квесты вы сможете пройти за {formatTimeLength(route.averageTime)}
</p>
<h3>{route.name}</h3>
<p>{route.description}</p>
<p>Длинна маршрута: {route.length} м</p>
<p>Примерное время прохождения: {route.averageTime}</p>
<p>Точка старта:</p>

View File

@ -7,7 +7,7 @@ import styles from "styles/RouteView.module.css";
const RouteView: React.FC<IRouteView> = ({ header, routes }) => {
return (
<>
<h1 className={styles.header}>{header}</h1>
<h2 className={styles.header}>{header}</h2>
{routes.map((route) => (
<RouteCard key={route.id} route={route} />
))}