Event-Planner / client / src / App.js
App.js
Raw
import {React} from 'react';
import './App.css';
import {
  BrowserRouter,
  Routes,
  Route,
} from "react-router-dom";
import Login from './components/login/login'
import Register from './components/register/register.js'
import EventDashboard from './components/event-dashboard/event-dashboard'
import VenueSearch from './components/venue-search/venue-search'
import FavoriteVenues from './components/venue-search/favorite-venues/favorite-venues'
import ToDo from './components/to-do/to-do'
import BudgetTracker from './components/budget-tracker/budget-tracker'
import GuestList from './components/guest-list/guest-list'
import EventCreation from './components/event-creation/event-creation';
import ProtectedRoutes from './ProtectedRoutes'
import Logout from './components/log-out/log-out'

function App() {
  return (
    <BrowserRouter>
      <Routes>
          <Route exact path='/' element={<Login />} />
          <Route path='/register' element={<Register />} />
          <Route path='/event-creation' element={<ProtectedRoutes><EventCreation /></ProtectedRoutes>} />
          <Route path='/event-dashboard' element={<ProtectedRoutes><EventDashboard /></ProtectedRoutes>} />
          <Route path='/venue-search' element={<ProtectedRoutes><VenueSearch /></ProtectedRoutes>} />
          <Route path='/to-do' element={<ProtectedRoutes><ToDo /></ProtectedRoutes>} />
          <Route path='/budget-tracker' element={<ProtectedRoutes><BudgetTracker /></ProtectedRoutes>} />
          <Route path='/guest-list' element={<ProtectedRoutes><GuestList /></ProtectedRoutes>} />
          <Route path='/favorite-venues' element={<ProtectedRoutes><FavoriteVenues /></ProtectedRoutes>} />
          <Route path='/log-out' element={<ProtectedRoutes><Logout /></ProtectedRoutes>} />
      </Routes>
    </BrowserRouter>
  );
}

export default App;