2018-12-06 12:05:35 +11:00
|
|
|
import PublicTimeline from 'components/public_timeline/public_timeline.vue'
|
|
|
|
import PublicAndExternalTimeline from 'components/public_and_external_timeline/public_and_external_timeline.vue'
|
|
|
|
import FriendsTimeline from 'components/friends_timeline/friends_timeline.vue'
|
|
|
|
import TagTimeline from 'components/tag_timeline/tag_timeline.vue'
|
|
|
|
import ConversationPage from 'components/conversation-page/conversation-page.vue'
|
|
|
|
import Mentions from 'components/mentions/mentions.vue'
|
|
|
|
import DMs from 'components/dm_timeline/dm_timeline.vue'
|
|
|
|
import UserProfile from 'components/user_profile/user_profile.vue'
|
|
|
|
import Settings from 'components/settings/settings.vue'
|
|
|
|
import Registration from 'components/registration/registration.vue'
|
|
|
|
import UserSettings from 'components/user_settings/user_settings.vue'
|
|
|
|
import FollowRequests from 'components/follow_requests/follow_requests.vue'
|
|
|
|
import OAuthCallback from 'components/oauth_callback/oauth_callback.vue'
|
|
|
|
import UserSearch from 'components/user_search/user_search.vue'
|
2018-12-04 05:36:59 +11:00
|
|
|
|
|
|
|
export default (store) => {
|
|
|
|
return [
|
|
|
|
{ name: 'root',
|
|
|
|
path: '/',
|
|
|
|
redirect: _to => {
|
|
|
|
return (store.state.users.currentUser
|
|
|
|
? store.state.instance.redirectRootLogin
|
2018-12-10 09:21:52 +11:00
|
|
|
: store.state.instance.redirectRootNoLogin) || '/~/main/all'
|
2018-12-04 05:36:59 +11:00
|
|
|
}
|
|
|
|
},
|
2018-12-10 09:21:52 +11:00
|
|
|
{ name: 'public-external-timeline', path: '/~/main/all', component: PublicAndExternalTimeline },
|
|
|
|
{ name: 'public-timeline', path: '/~/main/public', component: PublicTimeline },
|
|
|
|
{ name: 'friends', path: '/~/main/friends', component: FriendsTimeline },
|
2018-12-17 10:26:40 +11:00
|
|
|
// Beginning of temporary redirects
|
|
|
|
{ path: '/main/:route',
|
|
|
|
redirect: to => {
|
|
|
|
const { params } = to
|
2018-12-17 11:01:24 +11:00
|
|
|
const route = params.route ? params.route : 'all'
|
2018-12-17 10:26:40 +11:00
|
|
|
|
2018-12-17 11:01:24 +11:00
|
|
|
return { path: `/~/main/${route}` }
|
2018-12-17 10:26:40 +11:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{ path: '/tag/:tag',
|
|
|
|
redirect: to => {
|
|
|
|
const { params } = to
|
|
|
|
|
|
|
|
return { path: `/~/tag/${params.tag}` }
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ path: '/notice/:id',
|
|
|
|
redirect: to => {
|
|
|
|
const { params } = to
|
|
|
|
|
|
|
|
return { path: `/~/notice/${params.id}` }
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// End of temporary redirects
|
2018-12-10 09:21:52 +11:00
|
|
|
{ name: 'tag-timeline', path: '/~/tag/:tag', component: TagTimeline },
|
|
|
|
{ name: 'conversation', path: '/~/notice/:id', component: ConversationPage, meta: { dontScroll: true } },
|
2018-12-06 12:05:35 +11:00
|
|
|
{ name: 'user-profile', path: '/:name', component: UserProfile },
|
2018-12-15 14:16:44 +11:00
|
|
|
{ name: 'external-user-profile', path: '/~/users/:id', component: UserProfile },
|
2018-12-04 05:36:59 +11:00
|
|
|
{ name: 'mentions', path: '/:username/mentions', component: Mentions },
|
|
|
|
{ name: 'dms', path: '/:username/dms', component: DMs },
|
2018-12-10 09:21:52 +11:00
|
|
|
{ name: 'settings', path: '/~/settings', component: Settings },
|
|
|
|
{ name: 'registration', path: '/~/registration', component: Registration },
|
|
|
|
{ name: 'registration', path: '/~/registration/:token', component: Registration },
|
|
|
|
{ name: 'friend-requests', path: '/~/friend-requests', component: FollowRequests },
|
|
|
|
{ name: 'user-settings', path: '/~/user-settings', component: UserSettings },
|
|
|
|
{ name: 'oauth-callback', path: '/~/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) },
|
|
|
|
{ name: 'user-search', path: '/~/user-search', component: UserSearch, props: (route) => ({ query: route.query.query }) }
|
2018-12-04 05:36:59 +11:00
|
|
|
]
|
|
|
|
}
|