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

feat: implements navbar #16

Merged
merged 3 commits into from
Feb 16, 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
52 changes: 10 additions & 42 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "0BSD",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"develop": "gatsby develop -H 0.0.0.0",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
"start": "npm run develop",
"serve": "gatsby serve",
Expand Down
3 changes: 2 additions & 1 deletion src/assets/scss/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
$orange: #f23827;
$orange-grey: #a64f47;
$red: #a60303;
$red: #a60303;
$grey: #eee;
37 changes: 37 additions & 0 deletions src/components/Navbar/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React, {Component} from "react";
import "./navbar.scss";
import { Link } from "gatsby";

class Navbar extends Component {
render(){
Copy link
Member

Choose a reason for hiding this comment

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

De acordo com o style guide do airbnb, adicionar o seguinte espaçamento melhora a legibilidade:

Suggested change
render(){
render () {

let home="/", blog="/", bibliography = "/";
let contact="/", join="/";

return (
<nav className="navbar navbar-fixed">
<Link to={home} className="nav-item">
Início
</Link>
<Link to={blog} className="nav-item">
Blog
</Link>
<div to="#" className="nav-item dropdown">
O grupo
<div className="dropdown-content">
<Link to={bibliography} className="dropdown-item">
Bibliografia
</Link>
<Link to={contact} className="dropdown-item">
Contato
</Link>
</div>
</div>
<Link to={join} className="nav-item">
Participar
</Link>
</nav>
);
}
}

export default Navbar;
62 changes: 62 additions & 0 deletions src/components/Navbar/navbar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@import "../../assets/scss/variables";


.navbar {
display: flex;
justify-content: flex-end;
padding: .5rem 1rem;
font-weight: 300;
background-color: $red;
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);
}

.navbar-fixed {
position: fixed;
top: 0;
right: 0;
left: 0;
}

.nav-item {
padding: 1rem;
text-decoration:none;
border-radius: 0.3rem;
color: white;

&:hover {
background-color: transparentize($color: $orange, $amount: 0.8);
}
}

.dropdown {
position: relative;
display: inline-block;

&-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}

&:hover &-content {
display: block;
top: 100%;
left: 0;
}

&-item {
display: block;
text-decoration: none;
color: darken($color: $orange-grey, $amount: 30%);
padding: 0.75rem 0.5rem;

&:hover {
background-color: $grey
}
}
}


2 changes: 2 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Component } from "react"
import Header from "../components/Header"
import Navbar from "../components/Navbar";

import AOS from "aos";
import "aos/dist/aos.css";
Expand All @@ -10,6 +11,7 @@ export default class IndexPage extends Component {
render() {
return (
<div>
<Navbar />
<Header
title="Grupo de Estudos em NLP - UFFS"
subtitle="Ea pariatur ea cupidatat irure in enim incididunt elit consectetur cupidatat."
Expand Down
1 change: 1 addition & 0 deletions src/styles/global.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "bootstrap/scss/bootstrap-grid.scss";