mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-16 21:50:35 +02:00
Update default routing
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
||||
import { Routes, Route } from 'react-router-dom';
|
||||
import { LibraryAlbumsRoute } from '@/renderer/features/library/routes/LibraryAlbumsRoute';
|
||||
import { LibraryArtistsRoute } from '@/renderer/features/library/routes/LibraryArtistsRoute';
|
||||
import { LibraryRoute } from '@/renderer/features/library/routes/LibraryRoute';
|
||||
import { AlbumListRoute } from '@/renderer/features/albums/routes/album-list-route';
|
||||
import { AuthOutlet } from '@/renderer/router/auth-outlet';
|
||||
import { PrivateOutlet } from '@/renderer/router/private-outlet';
|
||||
import { LoginRoute } from '../features/auth';
|
||||
@@ -24,25 +22,7 @@ export const AppRouter = () => {
|
||||
>
|
||||
<Route element={<DefaultLayout />}>
|
||||
<Route element={<DashboardRoute />} path={AppRoute.HOME} />
|
||||
<Route element={<></>} path={AppRoute.SEARCH} />
|
||||
|
||||
<Route element={<LibraryRoute />} path={AppRoute.LIBRARY} />
|
||||
<Route
|
||||
element={<DashboardRoute />}
|
||||
path={AppRoute.LIBRARY_ALBUMARTISTS}
|
||||
/>
|
||||
<Route
|
||||
element={<LibraryAlbumsRoute />}
|
||||
path={AppRoute.LIBRARY_ALBUMS}
|
||||
/>
|
||||
<Route
|
||||
element={<LibraryAlbumsRoute />}
|
||||
path={AppRoute.LIBRARY_ALBUMS}
|
||||
/>
|
||||
<Route
|
||||
element={<LibraryArtistsRoute />}
|
||||
path={AppRoute.LIBRARY_ARTISTS}
|
||||
/>
|
||||
<Route element={<AlbumListRoute />} path={AppRoute.LIBRARY_ALBUMS} />
|
||||
<Route element={<></>} path={AppRoute.LIBRARY_ARTISTS} />
|
||||
</Route>
|
||||
<Route element={<></>} path={AppRoute.PLAYING} />
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
// Referenced from: https://betterprogramming.pub/the-best-way-to-manage-routes-in-a-react-project-with-typescript-c4e8d4422d64
|
||||
|
||||
export enum AppRoute {
|
||||
EXPLORE = '/explore',
|
||||
HOME = '/',
|
||||
LIBRARY = '/library',
|
||||
LIBRARY_ALBUMARTISTS = '/library/album-artists',
|
||||
LIBRARY_ALBUMARTISTS_DETAIL = '/library/album-artists/:albumArtistId',
|
||||
LIBRARY_ALBUMS = '/library/albums',
|
||||
LIBRARY_ALBUMS_DETAIL = '/library/albums/:albumId',
|
||||
LIBRARY_ARTISTS = '/library/artists',
|
||||
LIBRARY_ARTISTS_DETAIL = '/library/artists/:artistId',
|
||||
LIBRARY_FOLDERS = '/library/folders',
|
||||
LIBRARY_SONGS = '/library/songs',
|
||||
LOGIN = '/login',
|
||||
PLAYING = '/playing',
|
||||
PLAYLISTS = '/playlists',
|
||||
@@ -19,6 +21,7 @@ export enum AppRoute {
|
||||
|
||||
type TArgs =
|
||||
| { path: AppRoute.HOME }
|
||||
| { path: AppRoute.EXPLORE }
|
||||
| { path: AppRoute.LOGIN }
|
||||
| { path: AppRoute.PLAYING }
|
||||
| { path: AppRoute.SERVERS }
|
||||
@@ -27,9 +30,9 @@ type TArgs =
|
||||
| { path: AppRoute.LIBRARY_ARTISTS_DETAIL }
|
||||
| { path: AppRoute.LIBRARY_ALBUMARTISTS }
|
||||
| { path: AppRoute.LIBRARY_ALBUMARTISTS_DETAIL }
|
||||
| { path: AppRoute.LIBRARY }
|
||||
| { path: AppRoute.LIBRARY }
|
||||
| { path: AppRoute.LIBRARY_ALBUMS }
|
||||
| { path: AppRoute.LIBRARY_FOLDERS }
|
||||
| { path: AppRoute.LIBRARY_SONGS }
|
||||
| {
|
||||
params: { albumId: string };
|
||||
path: AppRoute.LIBRARY_ALBUMS_DETAIL;
|
||||
|
||||
Reference in New Issue
Block a user