diff --git a/src/App.tsx b/src/App.tsx index f98754da..203e78a4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -226,7 +226,7 @@ const PrivateRoutes = () => { return ( { - } /> + } /> }> @@ -280,59 +280,47 @@ const MainApp = () => { } /> } /> - } - /> - } - /> - + } /> + } /> + } /> } /> - + } /> {/* TODO: deprecated - got moved to "settings/images/processing/downloads" */} } /> - + } /> } /> } /> - } /> - } /> - } /> - } /> - } /> - } /> - } - /> - } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> {/* Manga Routes */} @@ -340,9 +328,9 @@ const MainApp = () => { {/* TODO: deprecated - "source" and "extension" page got merged into "browse" */} } /> - } /> - } /> - } /> + } /> + } /> + } /> {/* TODO: deprecated - "source" and "extension" page got merged into "browse" */} @@ -350,11 +338,11 @@ const MainApp = () => { index element={} /> - } /> + } /> } /> - + } /> } /> @@ -364,12 +352,9 @@ const MainApp = () => { } /> } /> + } /> } - /> - } /> diff --git a/src/base/AppRoute.constants.ts b/src/base/AppRoute.constants.ts index 2fdee0a7..e410bedd 100644 --- a/src/base/AppRoute.constants.ts +++ b/src/base/AppRoute.constants.ts @@ -22,7 +22,7 @@ type AppRouteInfo = { state?: (...args: any[]) => Record; }; -type TAppRoutes = Record; +type TAppRoutes = Record; export const AppRoutes = { root: { @@ -35,7 +35,7 @@ export const AppRoutes = { authentication: { match: 'auth', path: '/auth', - childRoutes: { + children: { login: { match: 'login', path: '/auth/login', @@ -49,7 +49,7 @@ export const AppRoutes = { settings: { match: 'settings', path: '/settings', - childRoutes: { + children: { categories: { match: 'categories', path: '/settings/categories', @@ -62,7 +62,7 @@ export const AppRoutes = { match: 'library', path: '/settings/library', - childRoutes: { + children: { duplicates: { match: 'duplicates', path: '/settings/library/duplicates', @@ -72,7 +72,7 @@ export const AppRoutes = { download: { match: 'download', path: '/settings/download', - childRoutes: { + children: { // TODO: deprecated - got moved to "settings/images/processing/downloads" conversions: { match: 'conversions', @@ -83,7 +83,7 @@ export const AppRoutes = { images: { match: 'images', path: '/settings/images', - childRoutes: { + children: { processingDownloads: { match: 'processing/downloads', path: '/settings/images/processing/downloads', @@ -131,7 +131,7 @@ export const AppRoutes = { sources: { match: 'sources', path: '/sources', - childRoutes: { + children: { browse: { match: ':sourceId', path: (sourceId: SourceIdInfo['id'], query?: string | null | undefined) => @@ -151,11 +151,10 @@ export const AppRoutes = { }, }, }, - extension: { match: 'extension', path: '/extension', - childRoutes: { + children: { info: { match: ':pkgName', path: (pkgName: string) => `/extension/${pkgName}`, @@ -169,8 +168,7 @@ export const AppRoutes = { manga: { match: 'manga/:id', path: (mangaId: MangaIdInfo['id']) => `/manga/${mangaId}`, - - childRoutes: { + children: { reader: { match: 'chapter/:chapterNum', path: (mangaId: MangaIdInfo['id'], chapterNum: ChapterSourceOrderInfo['sourceOrder']) => @@ -208,7 +206,7 @@ export const AppRoutes = { migrate: { match: 'migrate/*', path: '/migrate', - childRoutes: { + children: { singleMangaSearch: { match: 'source/:sourceId/manga/:mangaId/search', path: (sourceId: SourceIdInfo['id'], mangaId: MangaIdInfo['id'], query?: string | null | undefined) => @@ -241,7 +239,7 @@ export const AppRoutes = { }, } as const satisfies TAppRoutes; -type ExtractChildRouteStringPaths = T extends { childRoutes: infer U } ? ExtractStringPaths : never; +type ExtractChildRouteStringPaths = T extends { children: infer U } ? ExtractStringPaths : never; type ExtractStringPaths = T extends { path: infer P } ? P extends string diff --git a/src/features/backup/component/BackupValidationDialog.tsx b/src/features/backup/component/BackupValidationDialog.tsx index a058562b..0ea34030 100644 --- a/src/features/backup/component/BackupValidationDialog.tsx +++ b/src/features/backup/component/BackupValidationDialog.tsx @@ -82,7 +82,7 @@ export const BackupValidationDialog = ({ diff --git a/src/features/browse/extensions/components/ExtensionCard.tsx b/src/features/browse/extensions/components/ExtensionCard.tsx index e40c21b3..6864510c 100644 --- a/src/features/browse/extensions/components/ExtensionCard.tsx +++ b/src/features/browse/extensions/components/ExtensionCard.tsx @@ -95,7 +95,7 @@ export function ExtensionCard(props: IProps) { return ( - + - navigate(AppRoutes.sources.childRoutes.searchAll.path())} color="inherit"> + navigate(AppRoutes.sources.children.searchAll.path())} color="inherit"> diff --git a/src/features/browse/sources/components/SourceCard.tsx b/src/features/browse/sources/components/SourceCard.tsx index 3a0bec22..4675f110 100644 --- a/src/features/browse/sources/components/SourceCard.tsx +++ b/src/features/browse/sources/components/SourceCard.tsx @@ -63,8 +63,8 @@ export const SourceCard: React.FC = (props: IProps) => { = (props: IProps) => { {...MUIUtil.preventRippleProp()} variant="outlined" component={Link} - to={AppRoutes.sources.childRoutes.browse.path(id)} - state={AppRoutes.sources.childRoutes.browse.state({ + to={AppRoutes.sources.children.browse.path(id)} + state={AppRoutes.sources.children.browse.state({ contentType: SourceContentType.LATEST, clearCache: true, })} diff --git a/src/features/category/components/CategorySelect.tsx b/src/features/category/components/CategorySelect.tsx index 5268594e..778e3332 100644 --- a/src/features/category/components/CategorySelect.tsx +++ b/src/features/category/components/CategorySelect.tsx @@ -248,11 +248,7 @@ export function CategorySelect(props: CategorySelectProps) { width: '100%', }} > - diff --git a/src/features/downloads/screens/DownloadSettings.tsx b/src/features/downloads/screens/DownloadSettings.tsx index 326199c8..74f89c2d 100644 --- a/src/features/downloads/screens/DownloadSettings.tsx +++ b/src/features/downloads/screens/DownloadSettings.tsx @@ -133,7 +133,7 @@ export const DownloadSettings = () => { onChange={(e) => updateSetting('downloadAsCbz', e.target.checked)} /> - + e.stopPropagation()} {...MUIUtil.preventRippleProp()} diff --git a/src/features/global-search/screens/SearchAll.tsx b/src/features/global-search/screens/SearchAll.tsx index 3942e977..2f49dbc3 100644 --- a/src/features/global-search/screens/SearchAll.tsx +++ b/src/features/global-search/screens/SearchAll.tsx @@ -193,7 +193,7 @@ const SourceSearchPreview = React.memo( @@ -376,7 +376,7 @@ export const SearchAll = ({ replace: true, state: { ...state, - ...AppRoutes.sources.childRoutes.searchAll.state({ + ...AppRoutes.sources.children.searchAll.state({ shouldShowOnlyPinnedSources: true, }), }, @@ -399,7 +399,7 @@ export const SearchAll = ({ replace: true, state: { ...state, - ...AppRoutes.sources.childRoutes.searchAll.state({ + ...AppRoutes.sources.children.searchAll.state({ shouldShowOnlyPinnedSources: false, }), }, diff --git a/src/features/library/screens/Library.tsx b/src/features/library/screens/Library.tsx index 8e2a6f97..511c46f8 100644 --- a/src/features/library/screens/Library.tsx +++ b/src/features/library/screens/Library.tsx @@ -179,7 +179,7 @@ export function Library() {