Files
habitica/website/client/router.js
Keith Holliday aee21edd5f [WIP] Began adding tavern and party (#8814)
* Began adding tavern and party

* Fixed routing conflicts and tavern constant

* Updated button styles

* Added not on quest block

* Added no challenge block

* Began adding quest details

* Began updating group create modal to have party info

* Added create party modal

* Added share userid menu

* Began adding toggle

* Finished toggle styles

* Added start quest modal

* Ported over party ctrl code

* Finished porting over party ctrl code

* Added more quest actions

* Added own quests modal and quest modal details

* Fixed member modal styles and icons

* Added many random style updates

* Small text align fix

* Removed extra update

* Removed config and extra key

* Removed client string extras
2017-06-27 14:02:55 -06:00

112 lines
3.9 KiB
JavaScript

import Vue from 'vue';
import VueRouter from 'vue-router';
import EmptyView from './components/emptyView';
// TODO Dummy elements used as placeholder until real components are implemented
import ParentPage from './components/parentPage';
import Page from './components/page';
// All the main level
// components are loaded in separate webpack chunks.
// See https://webpack.js.org/guides/code-splitting-async/
// for docs
// Tasks
const UserTasks = () => import(/* webpackChunkName: "userTasks" */'./components/tasks/user');
// Inventory
const InventoryContainer = () => import(/* webpackChunkName: "inventory" */'./components/inventory/index');
const ItemsPage = () => import(/* webpackChunkName: "inventory" */'./components/inventory/items/index');
const EquipmentPage = () => import(/* webpackChunkName: "inventory" */'./components/inventory/equipment/index');
const StablePage = () => import(/* webpackChunkName: "inventory" */'./components/inventory/stable/index');
// Social
const InboxPage = () => import(/* webpackChunkName: "inbox" */ './components/social/inbox/index');
const InboxConversationPage = () => import(/* webpackChunkName: "inbox" */ './components/social/inbox/conversationPage');
// Guilds
const GuildIndex = () => import(/* webpackChunkName: "guilds" */ './components/guilds/index');
// const TavernPage = () => import(/* webpackChunkName: "guilds" */ './components/guilds/tavern');
const MyGuilds = () => import(/* webpackChunkName: "guilds" */ './components/guilds/myGuilds');
const GuildsDiscoveryPage = () => import(/* webpackChunkName: "guilds" */ './components/guilds/discovery');
const GuildPage = () => import(/* webpackChunkName: "guilds" */ './components/guilds/guild');
Vue.use(VueRouter);
export default new VueRouter({
mode: 'history',
base: process.env.NODE_ENV === 'production' ? '/new-app' : __dirname, // eslint-disable-line no-process-env
linkActiveClass: 'active',
// When navigating to another route always scroll to the top
// To customize the behavior see https://router.vuejs.org/en/advanced/scroll-behavior.html
scrollBehavior () {
return { x: 0, y: 0 };
},
routes: [
{ name: 'tasks', path: '/', component: UserTasks },
{
path: '/inventory',
component: InventoryContainer,
children: [
{ name: 'items', path: 'items', component: ItemsPage },
{ name: 'equipment', path: 'equipment', component: EquipmentPage },
{ name: 'stable', path: 'stable', component: StablePage },
],
},
{ name: 'shops', path: '/shops', component: Page },
{ name: 'party', path: '/party', component: GuildPage },
{
path: '/guilds',
component: GuildIndex,
children: [
{ name: 'tavern', path: 'tavern', component: GuildPage },
{
name: 'myGuilds',
path: 'myGuilds',
component: MyGuilds,
},
{
name: 'guildsDiscovery',
path: 'discovery',
component: GuildsDiscoveryPage,
},
{
name: 'guild',
path: 'guild/:guildId',
component: GuildPage,
props: true,
},
],
},
{ name: 'challenges', path: 'challenges', component: Page },
{
path: '/user',
component: ParentPage,
children: [
{ name: 'avatar', path: 'avatar', component: Page },
{
path: 'inbox',
component: EmptyView,
children: [
{
name: 'inbox',
path: '',
component: InboxPage,
},
{
name: 'conversation',
path: 'conversation/:id',
component: InboxConversationPage,
},
],
},
{ name: 'stats', path: 'stats', component: Page },
{ name: 'achievements', path: 'achievements', component: Page },
{ name: 'settings', path: 'settings', component: Page },
],
},
],
});