correct highlighting of navbar

This commit is contained in:
Lukas Heiligenbrunner 2020-06-01 22:11:56 +02:00
parent 060348be9e
commit 3cc5c41a9b
3 changed files with 26 additions and 4 deletions

View File

@ -19,6 +19,7 @@
"eject": "react-scripts eject" "eject": "react-scripts eject"
}, },
"proxy": "http://127.0.0.1:4000", "proxy": "http://127.0.0.1:4000",
"homepage": "/",
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"
}, },

View File

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import MainBody from "./MainBody"; import MainBody from "./MainBody";
import "./css/App.css"
// include bootstraps css // include bootstraps css
import 'bootstrap/dist/css/bootstrap.min.css'; import 'bootstrap/dist/css/bootstrap.min.css';
@ -18,17 +19,26 @@ class App extends React.Component {
return ( return (
<div className="App"> <div className="App">
<nav className="navbar navbar-expand-sm bg-primary navbar-dark"> <nav className="navbar navbar-expand-sm bg-primary navbar-dark">
<a className="navbar-brand" href="# ">Lukis Tube</a> <div className="navbar-brand">Lukis Tube</div>
<ul className="navbar-nav"> <ul className="navbar-nav">
<li className="nav-item"> <li className="nav-item">
<a className="nav-link" onClick={() => this.loadHomePage()} href='# '>Home</a> <div className="nav-link"
style={this.state.page === "default" ? {color: "rgba(255,255,255,.75"} : {}}
onClick={() => this.loadHomePage()}>Home
</div>
</li> </li>
<li className="nav-item"> <li className="nav-item">
<a className="nav-link" onClick={() => this.loadRandomPage()} href="# ">Random Video</a> <div className="nav-link"
style={this.state.page === "random" ? {color: "rgba(255,255,255,.75"} : {}}
onClick={() => this.loadRandomPage()}>Random Video
</div>
</li> </li>
<li className="nav-item"> <li className="nav-item">
<a className="nav-link" onClick={() => this.loadCategoriesPage()} href="# ">Categories</a> <div className="nav-link"
style={this.state.page === "categories" ? {color: "rgba(255,255,255,.75"} : {}}
onClick={() => this.loadCategoriesPage()}>Categories
</div>
</li> </li>
</ul> </ul>
</nav> </nav>

11
src/css/App.css Normal file
View File

@ -0,0 +1,11 @@
.nav-item{
cursor: pointer;
}
.nav-link{
color: rgba(255,255,255,.5);
font-weight: bold;
}
.nav-link:hover{
color: rgba(255,255,255,1);
}