From 6f58e767a23a590d8c69773b180402290139145d Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Wed, 14 Jun 2023 15:30:16 +0200 Subject: [PATCH] Clean code --- geneit_app/src/routes/ProfileRoute.tsx | 10 ++++------ geneit_app/src/routes/auth/PasswordForgottenRoute.tsx | 4 +--- geneit_app/src/widgets/BaseLoginpage.tsx | 9 --------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/geneit_app/src/routes/ProfileRoute.tsx b/geneit_app/src/routes/ProfileRoute.tsx index 83ab707..de17be7 100644 --- a/geneit_app/src/routes/ProfileRoute.tsx +++ b/geneit_app/src/routes/ProfileRoute.tsx @@ -1,6 +1,3 @@ -import React, { useRef } from "react"; -import { AsyncWidget } from "../widgets/AsyncWidget"; -import { ReplacePasswordResponse, User, UserApi } from "../api/UserApi"; import { Alert, Box, @@ -9,15 +6,16 @@ import { CardActions, CardContent, Checkbox, - CircularProgress, FormControlLabel, TextField, Typography, } from "@mui/material"; -import { TimeWidget, formatDate } from "../widgets/TimeWidget"; +import React, { useRef } from "react"; import { ServerApi } from "../api/ServerApi"; +import { ReplacePasswordResponse, User, UserApi } from "../api/UserApi"; +import { AsyncWidget } from "../widgets/AsyncWidget"; import { PasswordInput } from "../widgets/PasswordInput"; -import { normalize } from "path/win32"; +import { formatDate } from "../widgets/TimeWidget"; export function ProfileRoute(): React.ReactElement { const [user, setUser] = React.useState(null); diff --git a/geneit_app/src/routes/auth/PasswordForgottenRoute.tsx b/geneit_app/src/routes/auth/PasswordForgottenRoute.tsx index 3c05e6d..7c435a7 100644 --- a/geneit_app/src/routes/auth/PasswordForgottenRoute.tsx +++ b/geneit_app/src/routes/auth/PasswordForgottenRoute.tsx @@ -3,15 +3,13 @@ import { Box, Button, CircularProgress, - Grid, TextField, Typography, } from "@mui/material"; import React from "react"; -import { ServerApi } from "../../api/ServerApi"; import { Link } from "react-router-dom"; -import { APIClient } from "../../api/ApiClient"; import { AuthApi } from "../../api/AuthApi"; +import { ServerApi } from "../../api/ServerApi"; export function PasswordForgottenRoute(): React.ReactElement { const [loading, setLoading] = React.useState(false); diff --git a/geneit_app/src/widgets/BaseLoginpage.tsx b/geneit_app/src/widgets/BaseLoginpage.tsx index 258a607..e32b2ae 100644 --- a/geneit_app/src/widgets/BaseLoginpage.tsx +++ b/geneit_app/src/widgets/BaseLoginpage.tsx @@ -35,15 +35,6 @@ function Copyright(props: any) { } export function BaseLoginPage() { - const handleSubmit = (event: React.FormEvent) => { - event.preventDefault(); - const data = new FormData(event.currentTarget); - console.log({ - email: data.get("email"), - password: data.get("password"), - }); - }; - return (