-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log in and Signup pages added #142
Changes from 6 commits
c4c4b43
79bf3e5
8fe7b57
0d7af4d
53862dd
179f92a
eb361bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,8 @@ const App = () => { | |
ProfilePicture: { | ||
Set: false, | ||
ProfileImage: | ||
"https://cdn.nerdschalk.com/wp-content/uploads/2020/09/how-to-remove-profile-picture-on-zoom-12.png?width=150" | ||
} | ||
"https://cdn.nerdschalk.com/wp-content/uploads/2020/09/how-to-remove-profile-picture-on-zoom-12.png?width=150", | ||
}, | ||
}, | ||
Experience: [], | ||
Education: [], | ||
|
@@ -38,7 +38,7 @@ const App = () => { | |
const SetSection = (Section, Content) => { | ||
setAppState({ | ||
...appState, | ||
Resume: { ...appState.Resume, [Section]: Content } | ||
Resume: { ...appState.Resume, [Section]: Content }, | ||
}); | ||
}; | ||
const SetSwitch = () => { | ||
|
@@ -50,16 +50,16 @@ const App = () => { | |
...appState.Resume.About, | ||
ProfilePicture: { | ||
...appState.Resume.About.ProfilePicture, | ||
Set: !(appState.Resume.About.ProfilePicture.Set) | ||
} | ||
} | ||
} | ||
}) | ||
Set: !appState.Resume.About.ProfilePicture.Set, | ||
}, | ||
}, | ||
}, | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Configure prettier to not have trailing commas. |
||
}; | ||
const ImageHandler = (e) => { | ||
const reader = new FileReader(); | ||
reader.onload = () => { | ||
if(reader.readyState === 2){ | ||
if (reader.readyState === 2) { | ||
setAppState({ | ||
...appState, | ||
Resume: { | ||
|
@@ -68,15 +68,15 @@ const App = () => { | |
...appState.Resume.About, | ||
ProfilePicture: { | ||
...appState.Resume.About.ProfilePicture, | ||
ProfileImage: reader.result | ||
} | ||
} | ||
} | ||
}) | ||
ProfileImage: reader.result, | ||
}, | ||
}, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Configure prettier to not have trailing commas. |
||
}); | ||
} | ||
} | ||
reader.readAsDataURL(e.target.files[0]) | ||
} | ||
}; | ||
reader.readAsDataURL(e.target.files[0]); | ||
}; | ||
return ( | ||
<div className="rezume"> | ||
<Header | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import React from "react"; | ||
import NavLink from "./_NavLink"; | ||
import { Link } from "react-router-dom"; | ||
|
||
const Header = ({ ChangePage, CurrentPage, Resume }) => { | ||
return ( | ||
<nav className="navbar navbar-expand navbar-dark justify-content-between rezume-header"> | ||
<span className="navbar-brand mb-0 h1 col-1">Rezume</span> | ||
<ul className="navbar-nav"> | ||
{Object.keys(Resume).map(NavItem => ( | ||
{Object.keys(Resume).map((NavItem) => ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Configure prettier to not have extra parentheses. |
||
<NavLink | ||
Name={NavItem} | ||
Active={CurrentPage === NavItem} | ||
|
@@ -15,6 +16,9 @@ const Header = ({ ChangePage, CurrentPage, Resume }) => { | |
/> | ||
))} | ||
</ul> | ||
<Link to="/login" className="btn btn-primary btn-sm col-1"> | ||
Login | ||
</Link> | ||
<a | ||
href="https://rezyume.co/" | ||
target="_blank" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import App from "./components/App"; | ||
|
||
import "./styles/App.scss"; | ||
import App from "./components/App.js"; | ||
import Login from "./pages/LoginPage"; | ||
import Signup from "./pages/SignupPage"; | ||
import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; | ||
import * as serviceWorker from "./serviceWorker"; | ||
|
||
ReactDOM.render(<App />, document.getElementById("root")); | ||
|
||
// If you want your app to work offline and load faster, you can change | ||
// unregister() to register() below. Note this comes with some pitfalls. | ||
// Learn more about service workers: https://bit.ly/CRA-PWA | ||
ReactDOM.render( | ||
<Router> | ||
<Routes> | ||
<Route exact path="/" element={<App />}></Route> | ||
<Route path="/login" element={<Login />}></Route> | ||
<Route path="/signup" element={<Signup />}></Route> | ||
Comment on lines
+13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use |
||
</Routes> | ||
</Router>, | ||
document.getElementById("root") | ||
); | ||
serviceWorker.unregister(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from "react"; | ||
import "./index.scss"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put the SCSS in the right directory and do not import it this way. |
||
import { Link } from "react-router-dom"; | ||
|
||
function Login() { | ||
const [email, setEmail] = React.useState(""); | ||
const [password, setPassword] = React.useState(""); | ||
const [emailError, setEmailError] = React.useState(""); | ||
const [passwordError, setPasswordError] = React.useState(""); | ||
|
||
function handleSubmit() { | ||
if (email === "") { | ||
setEmailError("Required"); | ||
} else { | ||
setEmailError(""); | ||
} | ||
if (password === "") { | ||
setPasswordError("No Password provided"); | ||
} else { | ||
setPasswordError(""); | ||
} | ||
} | ||
|
||
return ( | ||
<div className="container"> | ||
<form className="loginform"> | ||
<h1>Log In</h1> | ||
<input | ||
className="inputEmail" | ||
type="email" | ||
placeholder="Email" | ||
autocomplete="off" | ||
onChange={(e) => setEmail(e.target.value)} | ||
required | ||
/> | ||
<p className="alert">{emailError}</p> | ||
<input | ||
className="inputPassword" | ||
type="password" | ||
placeholder="Password" | ||
autocomplete="off" | ||
onChange={(e) => setPassword(e.target.value)} | ||
required | ||
/> | ||
<p className="alert">{passwordError}</p> | ||
<input | ||
className="inputSubmit" | ||
type="submit" | ||
value="Login" | ||
onClick={handleSubmit} | ||
/> | ||
<Link to="/Signup">New User ?</Link> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove space before |
||
</form> | ||
</div> | ||
); | ||
} | ||
|
||
export default Login; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.loginform { | ||
background-color: #003100; | ||
padding: 2rem; | ||
height: 400px; | ||
} | ||
.inputSubmit { | ||
background-color: #0000ff; | ||
color: white; | ||
margin-left: 1rem; | ||
border-radius: 10px; | ||
width: 100px; | ||
outline-width: 0; | ||
margin-right: 20px; | ||
margin-top: 20px; | ||
Comment on lines
+9
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better and concise CSS? |
||
} | ||
|
||
.Submit-form { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
margin-top: 20px; | ||
} | ||
h1 { | ||
color: greenyellow; | ||
} | ||
.alert { | ||
color: red; | ||
text-align: left; | ||
margin: 0px; | ||
margin-left: 12rem; | ||
padding: 0px; | ||
} | ||
.inputEmail { | ||
margin-bottom: 0px; | ||
border-radius: 10px; | ||
outline-width: 0; | ||
width: 350px; | ||
padding: 0.4rem; | ||
} | ||
.inputPassword { | ||
margin-bottom: 0px; | ||
border-radius: 10px; | ||
outline-width: 0; | ||
width: 350px; | ||
padding: 0.4rem; | ||
margin-top: 20px; | ||
} | ||
Comment on lines
+33
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better CSS? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configure prettier to not have trailing commas.