1
0
mirror of https://github.com/mgerb/react-starter synced 2026-01-12 10:02:49 +00:00

added wrapper and navbar

This commit is contained in:
2017-02-02 23:56:05 +00:00
committed by Mitchell Gerber
parent 73bd161685
commit 5f14578f86
16 changed files with 128 additions and 120 deletions

View File

@@ -1,13 +1,16 @@
import React from 'react';
import { Link } from 'react-router';
import './Navbar.scss';
export default class Navbar extends React.Component {
render() {
return (
<div className="Navbar">
<Link to="/" className="Navbar__item" onlyActiveOnIndex activeClassName="active">Home</Link>
<Link to="/new" className="Navbar__item" activeClassName="active">New</Link>
<div className="Navbar__header">Title</div>
<Link to="/" className="Navbar__item" onlyActiveOnIndex activeClassName="Navbar__item--active">Home</Link>
<Link to="/new" className="Navbar__item" activeClassName="Navbar__item--active">New</Link>
</div>
);
}

View File

@@ -0,0 +1,47 @@
@import '../../scss/variables';
.Navbar {
position: fixed;
display: flex;
flex-direction: column;
top: 0;
left: 0;
height: 100%;
width: $navbarWidth;
background-color: $gray2;
border-right: 1px solid darken($gray2, 2%);
overflow-y: auto;
}
.Navbar__header {
min-height: 100px;
display: flex;
align-items: center;
justify-content: center;
background-color: $gray2;
}
.Navbar__item {
min-height: 50px;
text-decoration: none;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
color: $white;
transition: background-color 0.1s linear;
&:hover {
background-color: $gray1;
}
& + .Navbar__item {
border-top: 1px solid $gray1;
}
}
.Navbar__item--active {
padding-left: 4px;
border-right: 4px solid $primaryBlue;
}