-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpage_to_page_mapping.js
More file actions
43 lines (40 loc) · 1.38 KB
/
page_to_page_mapping.js
File metadata and controls
43 lines (40 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import MessagesIndex from "@views/messages";
import MessagesShow from "@views/messages/show";
import ProfileIndex from "@views/users/profiles";
import SectionIndex from "@views/messages/section"
// import your page component
// e.g import PostsEdit from '../views/posts/edit'
// Mapping between your props template to Component, you must add to this
// to register any new page level component you create. If you are using the
// scaffold, it will auto append the identifers for you.
//
// For example:
//
// const pageIdentifierToPageComponent = {
// 'posts/new': PostNew
// };
//
//
// If you are using a build tool that supports globbing, you can automatically
// populate `pageIdentiferToPageComponent`. For example, if you are using vite,
// you can use the following snippet instead of manually importing.
//
// ```
// const pageIdentifierToPageComponent = {}
// const pages = import.meta.glob('../views/**/*.jsx', {eager: true})
//
// for (const key in pages) {
// if (pages.hasOwnProperty(key)) {
// const identifier = key.replace("../views/", "").split('.')[0];
// pageIdentifierToPageComponent[identifier] = pages[key].default;
// }
// }
// ```
//
const pageIdentifierToPageComponent = {
'messages/index': MessagesIndex,
'messages/show': MessagesShow,
'users/profiles/index': ProfileIndex,
'messages/section': SectionIndex,
};
export { pageIdentifierToPageComponent }