mobilizon/js/src/router/actor.ts

51 lines
1.2 KiB
TypeScript
Raw Normal View History

2019-02-22 13:55:47 +00:00
import Profile from '@/views/Account/Profile.vue';
2019-04-26 13:22:16 +00:00
import MyAccount from '@/views/Account/MyAccount.vue';
2019-02-22 13:55:47 +00:00
import CreateGroup from '@/views/Group/Create.vue';
import Group from '@/views/Group/Group.vue';
import GroupList from '@/views/Group/GroupList.vue';
import { RouteConfig } from 'vue-router';
2019-02-22 13:55:47 +00:00
export enum ActorRouteName {
GROUP_LIST = 'GroupList',
GROUP = 'Group',
CREATE_GROUP = 'CreateGroup',
PROFILE = 'Profile',
2019-04-26 13:22:16 +00:00
MY_ACCOUNT = 'MyAccount',
2019-02-22 13:55:47 +00:00
}
export const actorRoutes: RouteConfig[] = [
2019-02-22 13:55:47 +00:00
{
path: '/groups',
name: ActorRouteName.GROUP_LIST,
component: GroupList,
meta: { requiredAuth: false },
},
{
path: '/groups/create',
name: ActorRouteName.CREATE_GROUP,
component: CreateGroup,
meta: { requiredAuth: true },
},
{
path: '/~:preferredUsername',
2019-02-22 13:55:47 +00:00
name: ActorRouteName.GROUP,
component: Group,
props: true,
meta: { requiredAuth: false },
},
{
path: '/@:name',
name: ActorRouteName.PROFILE,
component: Profile,
props: true,
meta: { requiredAuth: false },
},
2019-04-26 13:22:16 +00:00
{
path: '/my-account',
name: ActorRouteName.MY_ACCOUNT,
component: MyAccount,
props: true,
meta: { requiredAuth: true },
},
2019-02-22 13:55:47 +00:00
];