Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class App extends React.Component {
- render() {
- return (
- <div>
- <BannerTop />
- <h1>Lorem ipsum</h1>
- <Navigation />
- <Switch>
- <Route path='/o-nas' strict exact component={AboutUs} />
- <Route path='/' strict exact component={Home} />
- <Redirect to='/' />
- </Switch>
- </div>
- );
- }
- }
- class BannerTop extends Component {
- state = {};
- render() {
- return (
- <section className={this.changeClass()} id='banner-top'>
- <div className='container'> Lorem </div>
- </section>
- );
- }
- changeClass = () => {
- console.log(this.props.location);
- return window.location.pathname === '/' ? 'home' : 'other';
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement