feat: web (#6)
This commit is contained in:
parent
ab667afc30
commit
26c2512d61
60 changed files with 937 additions and 547 deletions
21
src/renderer/src/routes.tsx
Normal file
21
src/renderer/src/routes.tsx
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { match } from 'path-to-regexp'
|
||||
import { isValidElement } from 'react'
|
||||
import FollowingListPage from './pages/secondary/FollowingListPage'
|
||||
import HashtagPage from './pages/secondary/HashtagPage'
|
||||
import HomePage from './pages/secondary/HomePage'
|
||||
import NotePage from './pages/secondary/NotePage'
|
||||
import ProfilePage from './pages/secondary/ProfilePage'
|
||||
|
||||
const ROUTES = [
|
||||
{ path: '/', element: <HomePage /> },
|
||||
{ path: '/note/:id', element: <NotePage /> },
|
||||
{ path: '/user/:id', element: <ProfilePage /> },
|
||||
{ path: '/user/:id/following', element: <FollowingListPage /> },
|
||||
{ path: '/hashtag/:id', element: <HashtagPage /> }
|
||||
]
|
||||
|
||||
export const routes = ROUTES.map(({ path, element }) => ({
|
||||
path,
|
||||
element: isValidElement(element) ? element : null,
|
||||
matcher: match(path)
|
||||
}))
|
||||
Loading…
Add table
Add a link
Reference in a new issue