2016-08-10 21:36:11 +02:00
|
|
|
/**
|
|
|
|
* Routes for the React app.
|
|
|
|
*/
|
2016-07-07 23:23:18 +02:00
|
|
|
import React from "react";
|
|
|
|
import { IndexRoute, Route } from "react-router";
|
|
|
|
|
|
|
|
import RequireAuthentication from "./containers/RequireAuthentication";
|
|
|
|
import App from "./containers/App";
|
|
|
|
import SimpleLayout from "./components/layouts/Simple";
|
|
|
|
import SidebarLayout from "./components/layouts/Sidebar";
|
2016-08-12 00:57:12 +02:00
|
|
|
import ArtistPage from "./views/ArtistPage";
|
|
|
|
import ArtistsPage from "./views/ArtistsPage";
|
|
|
|
import AlbumsPage from "./views/AlbumsPage";
|
2016-07-07 23:23:18 +02:00
|
|
|
import BrowsePage from "./views/BrowsePage";
|
2016-08-03 15:44:29 +02:00
|
|
|
import DiscoverPage from "./views/DiscoverPage";
|
2016-07-07 23:23:18 +02:00
|
|
|
import HomePage from "./views/HomePage";
|
|
|
|
import LoginPage from "./views/LoginPage";
|
|
|
|
import LogoutPage from "./views/LogoutPage";
|
2016-08-12 00:57:12 +02:00
|
|
|
import PlaylistPage from "./views/PlaylistPage";
|
2016-07-07 23:23:18 +02:00
|
|
|
import SongsPage from "./views/SongsPage";
|
2016-09-18 20:57:51 +02:00
|
|
|
import SettingsPage from "./views/SettingsPage";
|
2016-07-07 23:23:18 +02:00
|
|
|
|
|
|
|
export default (
|
2016-08-10 21:36:11 +02:00
|
|
|
<Route path="/" component={App}> // Main container is App
|
|
|
|
<Route path="login" component={SimpleLayout}> // Login is a SimpleLayout
|
2016-07-07 23:23:18 +02:00
|
|
|
<IndexRoute component={LoginPage} />
|
|
|
|
</Route>
|
2016-08-10 21:36:11 +02:00
|
|
|
<Route component={SidebarLayout}> // All the rest is a SidebarLayout
|
2016-07-07 23:23:18 +02:00
|
|
|
<Route path="logout" component={LogoutPage} />
|
2016-08-10 21:36:11 +02:00
|
|
|
<Route component={RequireAuthentication}> // And some pages require authentication
|
2016-08-03 15:44:29 +02:00
|
|
|
<Route path="discover" component={DiscoverPage} />
|
2016-07-07 23:23:18 +02:00
|
|
|
<Route path="browse" component={BrowsePage} />
|
|
|
|
<Route path="artists" component={ArtistsPage} />
|
2016-08-12 13:57:53 +02:00
|
|
|
<Route path="artist/:artist" component={ArtistPage} />
|
2016-07-07 23:23:18 +02:00
|
|
|
<Route path="albums" component={AlbumsPage} />
|
2016-08-12 13:57:53 +02:00
|
|
|
<Route path="artist/:artist/album/:album" component={ArtistPage} />
|
2016-07-07 23:23:18 +02:00
|
|
|
<Route path="songs" component={SongsPage} />
|
2016-08-12 00:57:12 +02:00
|
|
|
<Route path="playlist" component={PlaylistPage} />
|
2016-09-18 20:57:51 +02:00
|
|
|
<Route path="settings" component={SettingsPage} />
|
2016-07-07 23:23:18 +02:00
|
|
|
<IndexRoute component={HomePage} />
|
|
|
|
</Route>
|
|
|
|
</Route>
|
|
|
|
</Route>
|
|
|
|
);
|