Code styling changes

This commit is contained in:
2023-07-13 18:38:31 +03:00
parent 9437c44054
commit 7b0ccc525c
33 changed files with 358 additions and 387 deletions

View File

@ -1,9 +1,9 @@
import { FormEventHandler } from 'react'
import { Card, Tabs, Tab } from "react-bootstrap"
import { useNavigate } from "react-router-dom";
import { Card, Tabs, Tab } from 'react-bootstrap'
import { useNavigate } from 'react-router-dom';
import { useAuth } from "../hooks/api";
import { setToken } from "../utils/auth";
import { useAuth } from '../hooks/api';
import { setToken } from '../utils/auth';
import { AuthForm } from '../components';
function LoginPage() {
@ -24,22 +24,22 @@ function LoginPage() {
password: formData.get('password') as string
}
const token = import.meta.env.PROD ? await doAuth(data, newAccount) : "a"
const token = import.meta.env.PROD ? await doAuth(data, newAccount) : 'a'
if (token) {
setToken(token)
navigate("/")
navigate('/')
}
}
return (
<Card className="m-4">
<Card className='m-4'>
<Card.Body>
<Tabs defaultActiveKey="register" fill justify className="mb-3">
<Tab eventKey="register" title="Регистрация">
<Tabs defaultActiveKey='register' fill justify className='mb-3'>
<Tab eventKey='register' title='Регистрация'>
<AuthForm handleAuth={handleAuth(true)} register={true} loading={loading} error={error} />
</Tab>
<Tab eventKey="login" title="Вход">
<Tab eventKey='login' title='Вход'>
<AuthForm handleAuth={handleAuth(false)} register={false} loading={loading} error={error} />
</Tab>
</Tabs>
@ -48,4 +48,4 @@ function LoginPage() {
)
}
export default LoginPage
export default LoginPage