From ab5f6fb06251a11471faad1cfe86e0f8fef0be30 Mon Sep 17 00:00:00 2001 From: mitchelljfs Date: Sun, 15 Jul 2018 22:40:29 -0700 Subject: [PATCH] Moved routes to its own component and folder; changed navbar css to be used as intended; changed exprience css; version bump --- package.json | 2 +- src/Website.js | 15 +++---------- src/components/Navbar/index.css | 27 +++++++++++----------- src/components/Navbar/index.js | 35 +++++++++++++++++++++-------- src/containers/Experience/index.css | 2 +- src/routes/index.js | 25 +++++++++++++++++++++ 6 files changed, 70 insertions(+), 36 deletions(-) create mode 100644 src/routes/index.js diff --git a/package.json b/package.json index d8b4422..f24d151 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-website", - "version": "0.2.18", + "version": "0.2.19", "private": true, "dependencies": { "@fortawesome/fontawesome": "^1.1.8", diff --git a/src/Website.js b/src/Website.js index 1018d77..7728fc9 100644 --- a/src/Website.js +++ b/src/Website.js @@ -1,13 +1,9 @@ // @flow import React from "react" -import { Route, Switch } from "react-router-dom" import Header from "./components/Header" import Navbar from "./components/Navbar" -import Home from "./containers/Home" -import Projects from "./containers/Projects" -import Experience from "./containers/Experience" -import Contact from "./containers/Contact" +import Routes from "./routes" import "./Website.css" @@ -18,14 +14,9 @@ class Website extends React.Component { return (
-
- - - - - - +
+
) diff --git a/src/components/Navbar/index.css b/src/components/Navbar/index.css index 6ca8a47..77c15d2 100644 --- a/src/components/Navbar/index.css +++ b/src/components/Navbar/index.css @@ -7,6 +7,12 @@ top: 0; } +.navbar-small { + bottom: 0; + padding-bottom: 5px; + top: auto; +} + .navbar-button { background-color: rgb(139, 191, 209); border-radius: 2px; @@ -30,53 +36,48 @@ width: 52.5%; } -.navbar-menu div { +.navbar-menu-button { border-radius: 3px; color: white; float: left; margin: 1% 2.5%; overflow: hidden; padding: 7px 0; + text-decoration: none; text-overflow: ellipsis; transition: background-color 0.2s, box-shadow 0.1s; width: 20%; } -.navbar-menu div:hover { +.navbar-menu-button:hover { background-color: rgb(86, 95, 118); } -.active-button div { +.active-button { background-color: rgb(130, 160, 196); box-shadow: 0 0 5px rgb(59, 64, 83) inset; } -.active-button div:hover { +.active-button:hover { background-color: rgb(139, 191, 209); } @media screen and (max-width: 500px) { - .navbar { - bottom: 0; - padding-bottom: 5px; - top: auto; - } - .navbar-menu { margin: auto; width: 75%; } - .navbar-menu div { + .navbar-menu-button { margin: 5px 0; padding: 5px 0; width: 100%; } - .navbar-menu div:hover { + .navbar-menu-button:hover { background-color: inherit; } - .active-button div:hover { + .active-button:hover { background-color: rgb(130, 160, 196); } } diff --git a/src/components/Navbar/index.js b/src/components/Navbar/index.js index 307cd21..6a106d2 100644 --- a/src/components/Navbar/index.js +++ b/src/components/Navbar/index.js @@ -25,20 +25,37 @@ class Navbar extends React.Component { } changeMenuOn="500px" largeMenuClassName="navbar" - smallMenuClassName="navbar" + smallMenuClassName="navbar navbar-small" menu={
- -
Home
+ + Home - -
Projects
+ + Projects - -
Experience
+ + Experience - -
Contact
+ + Contact
} diff --git a/src/containers/Experience/index.css b/src/containers/Experience/index.css index 0e75fbe..731ee8f 100644 --- a/src/containers/Experience/index.css +++ b/src/containers/Experience/index.css @@ -1,6 +1,6 @@ .experience-container { display: flex; - flex-flow: row wrap; + flex-flow: column nowrap; margin: 2% 0; } diff --git a/src/routes/index.js b/src/routes/index.js new file mode 100644 index 0000000..c97d502 --- /dev/null +++ b/src/routes/index.js @@ -0,0 +1,25 @@ +// @flow +import React from "react" +import { Route, Switch } from "react-router-dom" + +import Home from "../containers/Home" +import Projects from "../containers/Projects" +import Experience from "../containers/Experience" +import Contact from "../containers/Contact" + +type Props = {} + +class Routes extends React.Component { + render() { + return ( + + + + + + + ) + } +} + +export default Routes