]> Untitled Git - lemmy-ui.git/blob - src/shared/routes.ts
Make comment depth easier to track visually
[lemmy-ui.git] / src / shared / routes.ts
1 import { IRouteProps } from "inferno-router/dist/Route";
2 import { Communities } from "./components/community/communities";
3 import { Community } from "./components/community/community";
4 import { CreateCommunity } from "./components/community/create-community";
5 import { AdminSettings } from "./components/home/admin-settings";
6 import { Home } from "./components/home/home";
7 import { Instances } from "./components/home/instances";
8 import { Legal } from "./components/home/legal";
9 import { Login } from "./components/home/login";
10 import { Setup } from "./components/home/setup";
11 import { Signup } from "./components/home/signup";
12 import { Modlog } from "./components/modlog";
13 import { Inbox } from "./components/person/inbox";
14 import { PasswordChange } from "./components/person/password-change";
15 import { Profile } from "./components/person/profile";
16 import { RegistrationApplications } from "./components/person/registration-applications";
17 import { Reports } from "./components/person/reports";
18 import { Settings } from "./components/person/settings";
19 import { VerifyEmail } from "./components/person/verify-email";
20 import { CreatePost } from "./components/post/create-post";
21 import { Post } from "./components/post/post";
22 import { CreatePrivateMessage } from "./components/private_message/create-private-message";
23 import { Search } from "./components/search";
24 import { InitialFetchRequest } from "./interfaces";
25
26 interface IRoutePropsWithFetch extends IRouteProps {
27   // TODO Make sure this one is good.
28   fetchInitialData?(req: InitialFetchRequest): Promise<any>[];
29 }
30
31 export const routes: IRoutePropsWithFetch[] = [
32   {
33     path: `/`,
34     component: Home,
35     fetchInitialData: Home.fetchInitialData,
36     exact: true,
37   },
38   {
39     path: `/login`,
40     component: Login,
41   },
42   {
43     path: `/signup`,
44     component: Signup,
45   },
46   {
47     path: `/create_post`,
48     component: CreatePost,
49     fetchInitialData: CreatePost.fetchInitialData,
50   },
51   {
52     path: `/create_community`,
53     component: CreateCommunity,
54   },
55   {
56     path: `/create_private_message/:recipient_id`,
57     component: CreatePrivateMessage,
58     fetchInitialData: CreatePrivateMessage.fetchInitialData,
59   },
60   {
61     path: `/communities`,
62     component: Communities,
63     fetchInitialData: Communities.fetchInitialData,
64   },
65   {
66     path: `/post/:post_id`,
67     component: Post,
68     fetchInitialData: Post.fetchInitialData,
69   },
70   {
71     path: `/comment/:comment_id`,
72     component: Post,
73     fetchInitialData: Post.fetchInitialData,
74   },
75   {
76     path: `/c/:name`,
77     component: Community,
78     fetchInitialData: Community.fetchInitialData,
79   },
80   {
81     path: `/u/:username`,
82     component: Profile,
83     fetchInitialData: Profile.fetchInitialData,
84   },
85   {
86     path: `/inbox`,
87     component: Inbox,
88     fetchInitialData: Inbox.fetchInitialData,
89   },
90   {
91     path: `/settings`,
92     component: Settings,
93   },
94   {
95     path: `/modlog/:communityId`,
96     component: Modlog,
97     fetchInitialData: Modlog.fetchInitialData,
98   },
99   {
100     path: `/modlog`,
101     component: Modlog,
102     fetchInitialData: Modlog.fetchInitialData,
103   },
104   { path: `/setup`, component: Setup },
105   {
106     path: `/admin`,
107     component: AdminSettings,
108     fetchInitialData: AdminSettings.fetchInitialData,
109   },
110   {
111     path: `/reports`,
112     component: Reports,
113     fetchInitialData: Reports.fetchInitialData,
114   },
115   {
116     path: `/registration_applications`,
117     component: RegistrationApplications,
118     fetchInitialData: RegistrationApplications.fetchInitialData,
119   },
120   {
121     path: `/search`,
122     component: Search,
123     fetchInitialData: Search.fetchInitialData,
124   },
125   {
126     path: `/password_change/:token`,
127     component: PasswordChange,
128   },
129   {
130     path: `/verify_email/:token`,
131     component: VerifyEmail,
132   },
133   {
134     path: `/instances`,
135     component: Instances,
136     fetchInitialData: Instances.fetchInitialData,
137   },
138   { path: `/legal`, component: Legal },
139 ];