Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
erica-dong committed Jan 14, 2024
2 parents d5e75a3 + 7b70b06 commit c0c9f9f
Show file tree
Hide file tree
Showing 14 changed files with 397 additions and 216 deletions.
Binary file removed Roadmap.png
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"start": "react-scripts start",
"build": "CI=false react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand Down
Binary file added public/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="Plan your academic success at WPI - an educational companion made by students for students."
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo-icon.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
2 changes: 1 addition & 1 deletion src/components/Authorization/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "./Login.css";

// IMAGES
import pageImage from "../../assets/images/cover-image.jpeg";
import LoginView from "./LoginView/Login";
import LoginView from "./LoginView/LoginView";
import { useNavigate } from "react-router";

// LOGIN PAGE
Expand Down
3 changes: 0 additions & 3 deletions src/components/Authorization/LoginView/Login.css

This file was deleted.

124 changes: 0 additions & 124 deletions src/components/Authorization/LoginView/Login.jsx

This file was deleted.

8 changes: 8 additions & 0 deletions src/components/Authorization/LoginView/LoginView.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.br-10 {
border-radius: 50px;
}

.ant-col.ant-form-item-label {
padding: 0 !important;
}

127 changes: 127 additions & 0 deletions src/components/Authorization/LoginView/LoginView.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// IMPORTS
import { Button, Form, Input } from "antd";
import { auth, logInWithEmailAndPassword, loginWithMicrosoft, registerWithEmailAndPassword } from "../../../Firebase";
// IMAGES
// import publicLogo from "../../../assets/images/public.png";
import microsoft from "../../../assets/images/Microsoft_icon.svg.png";
import { useNavigate } from "react-router";
import "./LoginView.css";
import { useEffect, useState } from "react";
import { useAuthState } from "react-firebase-hooks/auth";

import publicLogo from "../../../assets/images/logo-black.png";

// ADMIN LOGIN VIEW
function LoginView(props) {
const navigate = useNavigate();

let [tab, setTab] = useState(false);

let [email, setEmail] = useState("");
let [password, setPassword] = useState("");

let [user, loading] = useAuthState(auth);

const login = (values) => {

tab === false ? logInWithEmailAndPassword(email, password) : registerWithEmailAndPassword(email, password);
};

const register = (values) => {
registerWithEmailAndPassword(email, password);
}


useEffect(() => {
if (user) {
navigate("/dashboard");
}
}
, [user]);


// DISPLAY ADMIN LOGIN VIEW
return props.show ? (
<div className="login">
<div className="login__container">
<img className="coverLogo" src={publicLogo}></img>
<Form
layout='vertical'
name="basic"
className="login_form"
style={{
width: 300,
}}
initialValues={{
remember: true,
}}
autoComplete="off"
size="large"
onFinish={login}
>
<p className="padded-text">
WPI Roadmap is a universal solution to introduce you to WPI's major requirement system. Developed by WPI students for WPI students (GoatHacks 2024).
</p>
<Form.Item
label="Email"
style={{marginTop:0, fontWeight:"bold"}}
wrapperCol={{
span: 20,
}}
>
<Input
size="large"
className="br-10 my-2"
style={{ width: 300 }}
onChange={(e) => {
setEmail(e.target.value);
}}
></Input>
</Form.Item>
<Form.Item
label="Password"
style={{marginTop:0, fontWeight:"bold"}}
>
<Input.Password
size="large"
className="br-10 my-3"
style={{ width: 300 }}
onChange={(e) => {
setPassword(e.target.value);
}
}
></Input.Password>
</Form.Item>
<Form.Item>
<Button
type="primary"
className="microsoft"
htmlType="submit"

>
{/* <img src={microsoft} height={"20px"} className="msft"></img> */}
{tab === false ? "Login" : "Register"}
</Button>
</Form.Item>
</Form>
<p className="footerText mx-auto">
<a className="link" onClick={() => setTab(!tab)} target="0">
{tab === false ? "Register" : "Back to login"}
</a>{" "}
{/* •{" "}
<a className="link" href="" target="0">
Privacy policy
</a>{" "} */}
{" "}
<a className="link" href="https://github.com/WPI-Roadmap" target="0">
Github
</a>{" "}
</p>
</div>
</div>
) : (
<></>
);
}

export default LoginView;
Loading

0 comments on commit c0c9f9f

Please sign in to comment.