Created
November 26, 2019 16:53
-
-
Save davidrosenlund/e5868ac718b3c401e6f28382ed3d1940 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, Fragment } from 'react'; | |
import { withRouter, Switch, Route, NavLink, BrowserRouter } from "react-router-dom"; | |
import './App.scss'; | |
class App extends Component { | |
state = { | |
casinos: [], | |
isbonus: false, | |
} | |
constructor(props) { | |
super(props); | |
} | |
getNavLinkClass = (path) => { | |
console.log(this.props.location); | |
return this.props.location === path ? 'current' : ''; | |
} | |
//callbackFunction = (childData) => { this.setState({isbonus: childData})}; | |
render() { | |
return( | |
<BrowserRouter> | |
<Fragment> | |
<div className="main-nav-container"> | |
<img src="/logo.png" className="logo" alt="logo" /> | |
<div className="nav-container"> | |
<ul className="snip1135"> | |
<li className={this.getNavLinkClass("/home")}> | |
<NavLink exact to="/" data-hover="Start">Start</NavLink> | |
</li> | |
</ul> | |
</div> | |
<div> | |
<Route exact path="/" component={Home} /> | |
<Route | |
exact | |
path="/bonuses" | |
component={Bonuses} /> | |
</div> | |
</Fragment> | |
</BrowserRouter> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment