2019-09-25 12:32:52 -06:00
|
|
|
import { globalView } from './views/global';
|
|
|
|
import { homeView } from './views/home';
|
2019-10-28 00:01:27 -06:00
|
|
|
import { aboutView } from './views/about';
|
2019-09-25 12:32:52 -06:00
|
|
|
import { loginView } from './views/login';
|
|
|
|
import { searchView } from './views/search';
|
2019-12-23 16:37:33 -07:00
|
|
|
import { shelvesView } from './views/shelves';
|
2019-09-25 12:32:52 -06:00
|
|
|
import { errorView } from './views/404';
|
|
|
|
|
|
|
|
export const appRoutes = (app) => {
|
2019-09-25 16:48:35 -06:00
|
|
|
app.route('/', (state, emit) => globalView(state, emit, homeView));
|
2019-09-25 12:32:52 -06:00
|
|
|
|
2019-10-28 00:01:27 -06:00
|
|
|
app.route('/about', (state, emit) => globalView(state, emit, aboutView));
|
|
|
|
|
2019-09-25 16:48:35 -06:00
|
|
|
app.route('/login', (state, emit) => globalView(state, emit, loginView));
|
2019-09-25 12:32:52 -06:00
|
|
|
|
2019-10-17 21:20:36 -06:00
|
|
|
app.route('/logout', () => window.location.reload()); // If Choo navigates here, refresh the page instead so the server can handle it and log out
|
|
|
|
|
2019-09-25 16:48:35 -06:00
|
|
|
app.route('/search', (state, emit) => globalView(state, emit, searchView));
|
2019-09-25 12:32:52 -06:00
|
|
|
|
2019-12-23 16:37:33 -07:00
|
|
|
app.route('/shelves', (state, emit) => globalView(state, emit, shelvesView));
|
|
|
|
|
2019-09-25 16:48:35 -06:00
|
|
|
app.route('/404', (state, emit) => globalView(state, emit, errorView));
|
2019-09-25 12:32:52 -06:00
|
|
|
}
|