-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
React Router v7 (but still using RouterProvider)
* Use "Component" instead of "Element" in route-tree * Enable react-router v7_partialHydration * Enable react-router v7_normalizeFormMethod + v7_fetcherPersist + v7_skipActionErrorRevalidation * Enable react-router v7_relativeSplatPath * Enable react-router v7_startTransition * Upgrade to react-router v7 * Remove react-router futures * Move Views from views/ to routes/ * Consolidate lib/route-tree.ts into routes.ts * Rename all route files into lowercase * Regenerate bun.lockb * Format package.json * Oopsie
- Loading branch information
Showing
29 changed files
with
115 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { NavLink } from 'react-router-dom'; | ||
import { NavLink } from 'react-router'; | ||
|
||
import { | ||
Menu, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { type RouteObject, createHashRouter } from 'react-router'; | ||
|
||
import GlobalErrorBoundary from './components/GlobalErrorBoundary'; | ||
import RootView from './routes/Root'; | ||
import ViewLibrary from './routes/library'; | ||
import ViewPlaylistDetails from './routes/playlist-details'; | ||
import ViewPlaylists from './routes/playlists'; | ||
import ViewSettings from './routes/settings'; | ||
import ViewSettingsAbout from './routes/settings-about'; | ||
import ViewSettingsAudio from './routes/settings-audio'; | ||
import ViewSettingsLibrary from './routes/settings-library'; | ||
import ViewSettingsUI from './routes/settings-ui'; | ||
import ViewTrackDetails from './routes/track-details'; | ||
|
||
const routeTree: RouteObject[] = [ | ||
{ | ||
path: '/', | ||
id: 'root', | ||
Component: RootView, | ||
loader: RootView.loader, | ||
HydrateFallback: () => null, // there should be no hydration as we're SPA-only | ||
ErrorBoundary: GlobalErrorBoundary, | ||
children: [ | ||
{ | ||
path: 'library', | ||
id: 'library', | ||
Component: ViewLibrary, | ||
loader: ViewLibrary.loader, | ||
}, | ||
{ | ||
path: 'playlists', | ||
id: 'playlists', | ||
Component: ViewPlaylists, | ||
loader: ViewPlaylists.loader, | ||
children: [ | ||
{ | ||
path: ':playlistID', | ||
id: 'playlist-details', | ||
Component: ViewPlaylistDetails, | ||
loader: ViewPlaylistDetails.loader, | ||
}, | ||
], | ||
}, | ||
{ | ||
path: 'settings', | ||
id: 'settings', | ||
Component: ViewSettings, | ||
children: [ | ||
{ | ||
path: 'library', | ||
Component: ViewSettingsLibrary, | ||
loader: ViewSettings.loader, | ||
}, | ||
{ | ||
path: 'interface', | ||
Component: ViewSettingsUI, | ||
loader: ViewSettings.loader, | ||
}, | ||
{ | ||
path: 'audio', | ||
Component: ViewSettingsAudio, | ||
loader: ViewSettings.loader, | ||
}, | ||
{ | ||
path: 'about', | ||
Component: ViewSettingsAbout, | ||
loader: ViewSettings.loader, | ||
}, | ||
], | ||
}, | ||
{ | ||
path: 'details/:trackID', | ||
Component: ViewTrackDetails, | ||
loader: ViewTrackDetails.loader, | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
const router = createHashRouter(routeTree); | ||
|
||
export default router; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/views/ViewSettingsAudio.tsx → src/routes/settings-audio.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters