You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.6 KiB
35 lines
1.6 KiB
import { match } from 'path-to-regexp' |
|
import { isValidElement } from 'react' |
|
import FollowingListPage from './pages/secondary/FollowingListPage' |
|
import MuteListPage from './pages/secondary/MuteListPage' |
|
import NoteListPage from './pages/secondary/NoteListPage' |
|
import NotePage from './pages/secondary/NotePage' |
|
import OthersRelaySettingsPage from './pages/secondary/OthersRelaySettingsPage' |
|
import ProfileEditorPage from './pages/secondary/ProfileEditorPage' |
|
import ProfileListPage from './pages/secondary/ProfileListPage' |
|
import ProfilePage from './pages/secondary/ProfilePage' |
|
import RelayPage from './pages/secondary/RelayPage' |
|
import RelaySettingsPage from './pages/secondary/RelaySettingsPage' |
|
import SettingsPage from './pages/secondary/SettingsPage' |
|
import WalletPage from './pages/secondary/WalletPage' |
|
|
|
const ROUTES = [ |
|
{ path: '/notes', element: <NoteListPage /> }, |
|
{ path: '/notes/:id', element: <NotePage /> }, |
|
{ path: '/users', element: <ProfileListPage /> }, |
|
{ path: '/users/:id', element: <ProfilePage /> }, |
|
{ path: '/users/:id/following', element: <FollowingListPage /> }, |
|
{ path: '/users/:id/relays', element: <OthersRelaySettingsPage /> }, |
|
{ path: '/relay-settings', element: <RelaySettingsPage /> }, |
|
{ path: '/settings', element: <SettingsPage /> }, |
|
{ path: '/wallet', element: <WalletPage /> }, |
|
{ path: '/profile-editor', element: <ProfileEditorPage /> }, |
|
{ path: '/relays/:url', element: <RelayPage /> }, |
|
{ path: '/mutes', element: <MuteListPage /> } |
|
] |
|
|
|
export const routes = ROUTES.map(({ path, element }) => ({ |
|
path, |
|
element: isValidElement(element) ? element : null, |
|
matcher: match(path) |
|
}))
|
|
|