Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. class App extends React.Component {
  2. render() {
  3. return (
  4. <div>
  5. <BannerTop />
  6.  
  7. <h1>Lorem ipsum</h1>
  8. <Navigation />
  9. <Switch>
  10. <Route path='/o-nas' strict exact component={AboutUs} />
  11. <Route path='/' strict exact component={Home} />
  12. <Redirect to='/' />
  13. </Switch>
  14. </div>
  15. );
  16. }
  17. }
  18.  
  19. class BannerTop extends Component {
  20. state = {};
  21. render() {
  22. return (
  23. <section className={this.changeClass()} id='banner-top'>
  24. <div className='container'> Lorem </div>
  25. </section>
  26. );
  27. }
  28.  
  29. changeClass = () => {
  30. console.log(this.props.location);
  31. return window.location.pathname === '/' ? 'home' : 'other';
  32. };
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement