Skip to content
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

#56 Responsive header #57

Merged
merged 2 commits into from
Dec 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
126 changes: 126 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"axios": "^0.20.0",
"bootstrap": "^5.1.3",
"chart.js": "^2.9.4",
"react": "^16.13.1",
"react-bootstrap": "^1.0.1",
"react-chartjs-2": "^2.11.1",
"react-dom": "^16.13.1",
"react-fontawesome": "^1.7.1",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import './App.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import {BrowserRouter as Router, Switch, Route} from 'react-router-dom';
import Navbar from './components/layout/Navbar'
import Footer from './components/layout/Footer';
Expand Down
29 changes: 15 additions & 14 deletions frontend/src/components/layout/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@ import React from "react";
import { NavLink } from "react-router-dom";
import "../styles/Navbar.css";
import FontAwesome from 'react-fontawesome';

import {Navbar,Nav} from 'react-bootstrap'
const links = [
{ name: "home", to: "/" },
{ name: "dashboard", to: "/dashboard" },
{ name: "about", to: "/about" },
{ name: "upcoming", to: "/upcoming" },
];

const Navbar = () => {
const Header = () => {
return (
<header className="header">
<div className="header-brand">
<Navbar className="header" expand="lg">
<Navbar.Brand className="header-brand">
<NavLink exact to="/">
<img src="/logo.png" alt="logo-here" />
<img src="/logo.png" alt="logo-here"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logo should be in the left and reduce the size of dropdown menu icon

</NavLink>
</div>
<nav className="header-nav">
<ul className="header-nav-links">
{links.map((link, id) => (
</Navbar.Brand>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav" className="justify-content-end">
<Nav>
{links.map((link, id) => (
<li key={id} className="header-link-item">
<NavLink
exact
Expand All @@ -32,7 +33,7 @@ const Navbar = () => {
</NavLink>
</li>
))}
<NavLink
<NavLink
exact
to="/signup"
className="header-link user"
Expand All @@ -43,10 +44,10 @@ const Navbar = () => {
size="2x"
/>
</NavLink>
</ul>
</nav>
</header>
</Nav>
</Navbar.Collapse>
</Navbar>
);
};

export default Navbar;
export default Header;
23 changes: 11 additions & 12 deletions frontend/src/components/styles/Navbar.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
.header {
display: flex;
justify-content: flex-end;
justify-content: space-between;
align-items: center;
padding: 5px 10%;
}

.header .header-brand {
text-transform: uppercase;
font-weight: 700;
margin-right: auto;
}

.header img{
.header img {
width: 75px;
vertical-align: middle;
}
Expand All @@ -24,11 +23,11 @@
padding-inline-start: 0;
}

.header .header-nav-links .user{
.header .header-nav-links .user {
margin-left: 100px;
}

.header .header-nav-links .user:hover{
.header .header-nav-links .user:hover {
border-bottom: none;
color: #000;
}
Expand All @@ -55,14 +54,14 @@

.header .header-link:hover {
outline: 0;
/* border-bottom: 2px solid #000; */
text-decoration: underline;
}
.header .fa-user:hover {
border-bottom: 2px solid #000;
}

@media all and (max-width: 600px) {
.header {
flex-direction: column;
}
.header .header-brand {
margin: 0 auto;
}
.navbar-toggler {
padding: 0.1rem 0.6rem;
font-size: 1rem;
}