Skip to content

Commit

Permalink
refactor(login): login to profile after successfull login
Browse files Browse the repository at this point in the history
  • Loading branch information
bas-kirill committed Aug 25, 2024
1 parent 4ce890f commit 41311e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
8 changes: 2 additions & 6 deletions client/src/pages/login/ui/Login.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import styles from "./styles/Login.page.module.css";
import { HeaderWidget } from "widgets/header";
import { FooterWidget } from "widgets/footer";
import { Form, useActionData, useNavigate } from "react-router-dom";
import { LogInAction } from "../api/action";
import { LoginAction } from "../api/action";
import { REGISTRATION_URL } from "shared/config/paths";

export function LoginPage() {
const actionData = useActionData() as LogInAction;
const actionData = useActionData() as LoginAction;
const navigate = useNavigate();

const handleRegisterRedirect = () => {
Expand All @@ -18,10 +18,6 @@ export function LoginPage() {
<>
<HeaderWidget />

{actionData?.errors.length === 0 && (
<div className={styles.login__ok}>✅ Welcome!</div>
)}

<Form method="post" className={styles.login__form}>
<input type="text" name="login" placeholder={"Login"} />
<input type="password" name="password" placeholder={"Password"} />
Expand Down
13 changes: 0 additions & 13 deletions client/src/pages/login/ui/styles/Login.page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,3 @@
font-size: 2em;
}
}

.login__ok {
max-width: 640px;
background-color: green;
font-size: 2em;
padding: 0 10px;
margin: 0 auto;
}

.login__error {
background-color: red;
padding: 20px 10px;
}

0 comments on commit 41311e0

Please sign in to comment.