changed login styles

This commit is contained in:
CodeServer 2022-03-31 07:44:51 +01:00
parent 3c9d8e4822
commit 6e4506adc2
2 changed files with 6 additions and 2 deletions

View File

@ -5,7 +5,6 @@ import Container from "@mui/material/Container";
import TextField from "@mui/material/TextField"; import TextField from "@mui/material/TextField";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import hsbcLogo from "../../assets/logo-png.png"; import hsbcLogo from "../../assets/logo-png.png";
import zoomLogo from "../../assets/zoom.png";
import LoginIcon from "@mui/icons-material/Login"; import LoginIcon from "@mui/icons-material/Login";
import useAuth from "../../hooks/useAuth"; import useAuth from "../../hooks/useAuth";
import axios from "../../api/axios"; import axios from "../../api/axios";
@ -30,6 +29,7 @@ const Login: React.FC = () => {
const [email, setEmail] = useState(""); const [email, setEmail] = useState("");
const [password, setPassword] = useState(""); const [password, setPassword] = useState("");
const [hasError, setHasError] = useState(false);
// const [errMsg, setErrMsg] = useState(''); // const [errMsg, setErrMsg] = useState('');
// const userRef = useRef(); // const userRef = useRef();
@ -73,6 +73,7 @@ const Login: React.FC = () => {
if (logedInUserId != undefined) { if (logedInUserId != undefined) {
setAuth["uuid"] = logedInUserId; setAuth["uuid"] = logedInUserId;
setAuth["isLoggedIn"] = true; setAuth["isLoggedIn"] = true;
setHasError(false);
store.dispatch(fetchMeetings(logedInUserId)); store.dispatch(fetchMeetings(logedInUserId));
store.dispatch(fetchUsers(logedInUserId)); store.dispatch(fetchUsers(logedInUserId));
store.dispatch(fetchFavorites(logedInUserId)); store.dispatch(fetchFavorites(logedInUserId));
@ -81,6 +82,7 @@ const Login: React.FC = () => {
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);
setHasError(true);
} }
setEmail(email); setEmail(email);
setPassword(""); setPassword("");
@ -109,6 +111,8 @@ const Login: React.FC = () => {
variant="outlined" variant="outlined"
value={password} value={password}
placeholder="Password" placeholder="Password"
error={hasError}
helperText={hasError ? "Email or Password Incorrect!" : ""}
type="password" type="password"
onChange={(event) => { onChange={(event) => {
setPassword(event.target.value); setPassword(event.target.value);

View File

@ -78,7 +78,7 @@ const Body: React.FC<Props> = ({ meeting }) => {
hourMod + hourMod +
":" + ":" +
// isoTime.slice(3, 5) + // isoTime.slice(3, 5) +
date.getMinutes() + (date.getMinutes() < 10 ? "0" + date.getMinutes() : "" + date.getMinutes()) +
(hour > 11 ? "PM" : "AM") (hour > 11 ? "PM" : "AM")
); );
}; };