Skip to content
Snippets Groups Projects
Main.js 1 KiB
Newer Older
  • Learn to ignore specific revisions
  • import React from 'react';
    
    Tamás Szabó's avatar
    Tamás Szabó committed
    import { Switch, Route, Redirect, withRouter } from 'react-router-dom';
    
    import Home from './pages/Home';
    import Trainers from './pages/Trainers';
    import Schedule from './pages/Schedule';
    import NotFound from './pages/NotFound';
    import Profile from './pages/Profile';
    import Statistics from './pages/Statistics';
    
    import Groups from './pages/Groups';
    
    import News from './pages/News';
    
    import EventDetail from './pages/EventDetail';
    
      <Switch>
        <Redirect exact from='/' to='/home' />
        <Route exact path='/home' component={Home} />
    
        <Route path='/news' component={News} />
    
        <Route path='/trainers' component={Trainers} />
        <Route path='/schedule' component={Schedule} />
        <Route path='/profile' component={withRouter(Profile)} />
        <Route path='/statistics' component={Statistics} />
    
        <Route path='/groups' component={Groups} />
    
        <Route path='/events/:id' component={EventDetail} />
    
        <Route component={NotFound} />
      </Switch>
    
    Sandor Bereczki's avatar
    Sandor Bereczki committed
    );
    
    export default Main;