Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"eject": "react-scripts eject"
},
"dependencies": {
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
Expand Down
Binary file added client/public/imgs/logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 6 additions & 15 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
import React from "react";
import logo from "./logo.svg";
import Home from "./pages/HomeView";
import { Head } from "./components";
import "./styles/App.css";

function App() {
let name = "Person";
let isLoggedIn = false;
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
<Head name={name} isLoggedIn={isLoggedIn} />
<Home />
</div>
);
}
Expand Down
8 changes: 8 additions & 0 deletions client/src/components/Head/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";
import Navbar from "../Navbar";

const Head = ({ isLoggedIn, name }) => (
<Navbar isLoggedIn={isLoggedIn} name={name} />
);

export default Head;
52 changes: 52 additions & 0 deletions client/src/components/Navbar/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from "react";
import AppBar from "@material-ui/core/AppBar";
import PermIdentityIcon from "@material-ui/icons/PermIdentityOutlined";
import Toolbar from "@material-ui/core/Toolbar";
import "../../styles/Navbar.css";

const LoginLink = () => (
<a id="nav-login" href="#login">
Login
</a>
);

const LogoutLink = () => (
<a id="nav-logout" href="#logout">
Logout
</a>
);

const ProfileLink = ({ name }) => (
<div id="nav-profile">
<PermIdentityIcon id="nav-profile-icon" />
<a id="nav-profile-link" href="#profile">
Hi {name}
</a>
</div>
);

const Navbar = ({ isLoggedIn, name }) => {
let loginOptions;

loginOptions = isLoggedIn ? (
<div className="right-nav">
<ProfileLink name={name} />
<LogoutLink />
</div>
) : (
<LoginLink />
);

return (
<div>
<AppBar>
<Toolbar classes={{ root: "nav" }}>
<img id="nav-logo" src="/imgs/logo-white.png" alt="Closegap Logo" />
{loginOptions}
</Toolbar>
</AppBar>
</div>
);
};

export default Navbar;
3 changes: 3 additions & 0 deletions client/src/components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Head from "./Head";

export { Head };
10 changes: 10 additions & 0 deletions client/src/pages/HomeView/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
import "../../styles/Home.css";

const Home = () => (
<div>
<h1 className="title">Welcome</h1>
</div>
);

export default Home;
11 changes: 11 additions & 0 deletions client/src/styles/Home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
body {
background-color: rgb(255, 250, 250);
}

.title {
padding-top: 100px;
color: #231d31;
font-family: Roboto;
font-size: 48px;
font-weight: normal;
}
48 changes: 48 additions & 0 deletions client/src/styles/Navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.nav {
background-color: rgb(37, 0, 50);
justify-content: space-between;
}

#nav-logo {
padding: 20px 10px;
}

.right-nav {
display: flex;
flex-direction: column;
align-items: flex-end;
}

#nav-login {
color: #ffffff;
text-transform: uppercase;
text-decoration: none;
font-family: Roboto;
}

#nav-logout {
padding-top: 4px;
color: rgb(233, 87, 62);
text-transform: uppercase;
text-decoration: none;
font-family: Roboto;
font-size: 14px;
}

#nav-profile {
display: flex;
align-items: center;
}

#nav-profile-icon {
color: rgb(233, 87, 62);
}

#nav-profile-link {
padding-left: 4px;
color: #ffffff;
text-decoration: none;
font-family: Roboto;
font-size: 18px;
font-weight: 500;
}
Loading