Rename "childRoutes" to "children"
This commit is contained in:
69
src/App.tsx
69
src/App.tsx
@@ -226,7 +226,7 @@ const PrivateRoutes = () => {
|
|||||||
return (
|
return (
|
||||||
<Navigate
|
<Navigate
|
||||||
to={{
|
to={{
|
||||||
pathname: AppRoutes.authentication.childRoutes.login.path,
|
pathname: AppRoutes.authentication.children.login.path,
|
||||||
search: `${SearchParam.REDIRECT}=${window.location.pathname}`,
|
search: `${SearchParam.REDIRECT}=${window.location.pathname}`,
|
||||||
}}
|
}}
|
||||||
replace
|
replace
|
||||||
@@ -263,7 +263,7 @@ const MainApp = () => {
|
|||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path={AppRoutes.authentication.match}>
|
<Route path={AppRoutes.authentication.match}>
|
||||||
<Route path={AppRoutes.authentication.childRoutes.login.match} element={<LoginPage />} />
|
<Route path={AppRoutes.authentication.children.login.match} element={<LoginPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route element={<PrivateRoutes />}>
|
<Route element={<PrivateRoutes />}>
|
||||||
@@ -280,59 +280,47 @@ const MainApp = () => {
|
|||||||
<Route path={AppRoutes.about.match} element={<About />} />
|
<Route path={AppRoutes.about.match} element={<About />} />
|
||||||
<Route path={AppRoutes.settings.match}>
|
<Route path={AppRoutes.settings.match}>
|
||||||
<Route index element={<Settings />} />
|
<Route index element={<Settings />} />
|
||||||
<Route
|
<Route path={AppRoutes.settings.children.categories.match} element={<CategorySettings />} />
|
||||||
path={AppRoutes.settings.childRoutes.categories.match}
|
<Route path={AppRoutes.settings.children.reader.match} element={<GlobalReaderSettings />} />
|
||||||
element={<CategorySettings />}
|
<Route path={AppRoutes.settings.children.library.match}>
|
||||||
/>
|
|
||||||
<Route
|
|
||||||
path={AppRoutes.settings.childRoutes.reader.match}
|
|
||||||
element={<GlobalReaderSettings />}
|
|
||||||
/>
|
|
||||||
<Route path={AppRoutes.settings.childRoutes.library.match}>
|
|
||||||
<Route index element={<LibrarySettings />} />
|
<Route index element={<LibrarySettings />} />
|
||||||
<Route
|
<Route
|
||||||
path={AppRoutes.settings.childRoutes.library.childRoutes.duplicates.match}
|
path={AppRoutes.settings.children.library.children.duplicates.match}
|
||||||
element={<LibraryDuplicates />}
|
element={<LibraryDuplicates />}
|
||||||
/>
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={AppRoutes.settings.childRoutes.download.match}>
|
<Route path={AppRoutes.settings.children.download.match}>
|
||||||
<Route index element={<DownloadSettings />} />
|
<Route index element={<DownloadSettings />} />
|
||||||
{/* TODO: deprecated - got moved to "settings/images/processing/downloads" */}
|
{/* TODO: deprecated - got moved to "settings/images/processing/downloads" */}
|
||||||
<Route
|
<Route
|
||||||
path={AppRoutes.settings.childRoutes.download.childRoutes.conversions.match}
|
path={AppRoutes.settings.children.download.children.conversions.match}
|
||||||
element={
|
element={
|
||||||
<Navigate
|
<Navigate
|
||||||
to={
|
to={AppRoutes.settings.children.images.children.processingDownloads.path}
|
||||||
AppRoutes.settings.childRoutes.images.childRoutes.processingDownloads
|
|
||||||
.path
|
|
||||||
}
|
|
||||||
replace
|
replace
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={AppRoutes.settings.childRoutes.images.match}>
|
<Route path={AppRoutes.settings.children.images.match}>
|
||||||
<Route index element={<ImagesSettings />} />
|
<Route index element={<ImagesSettings />} />
|
||||||
<Route
|
<Route
|
||||||
path={AppRoutes.settings.childRoutes.images.childRoutes.processingDownloads.match}
|
path={AppRoutes.settings.children.images.children.processingDownloads.match}
|
||||||
element={<ImageProcessingSetting type={ImageProcessingType.DOWNLOAD} />}
|
element={<ImageProcessingSetting type={ImageProcessingType.DOWNLOAD} />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path={AppRoutes.settings.childRoutes.images.childRoutes.processingServe.match}
|
path={AppRoutes.settings.children.images.children.processingServe.match}
|
||||||
element={<ImageProcessingSetting type={ImageProcessingType.SERVE} />}
|
element={<ImageProcessingSetting type={ImageProcessingType.SERVE} />}
|
||||||
/>
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={AppRoutes.settings.childRoutes.backup.match} element={<Backup />} />
|
<Route path={AppRoutes.settings.children.backup.match} element={<Backup />} />
|
||||||
<Route path={AppRoutes.settings.childRoutes.server.match} element={<ServerSettings />} />
|
<Route path={AppRoutes.settings.children.server.match} element={<ServerSettings />} />
|
||||||
<Route path={AppRoutes.settings.childRoutes.webui.match} element={<WebUISettings />} />
|
<Route path={AppRoutes.settings.children.webui.match} element={<WebUISettings />} />
|
||||||
<Route path={AppRoutes.settings.childRoutes.browse.match} element={<BrowseSettings />} />
|
<Route path={AppRoutes.settings.children.browse.match} element={<BrowseSettings />} />
|
||||||
<Route path={AppRoutes.settings.childRoutes.history.match} element={<HistorySettings />} />
|
<Route path={AppRoutes.settings.children.history.match} element={<HistorySettings />} />
|
||||||
<Route path={AppRoutes.settings.childRoutes.device.match} element={<DeviceSetting />} />
|
<Route path={AppRoutes.settings.children.device.match} element={<DeviceSetting />} />
|
||||||
<Route
|
<Route path={AppRoutes.settings.children.tracking.match} element={<TrackingSettings />} />
|
||||||
path={AppRoutes.settings.childRoutes.tracking.match}
|
<Route path={AppRoutes.settings.children.appearance.match} element={<Appearance />} />
|
||||||
element={<TrackingSettings />}
|
|
||||||
/>
|
|
||||||
<Route path={AppRoutes.settings.childRoutes.appearance.match} element={<Appearance />} />
|
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
{/* Manga Routes */}
|
{/* Manga Routes */}
|
||||||
@@ -340,9 +328,9 @@ const MainApp = () => {
|
|||||||
<Route path={AppRoutes.sources.match}>
|
<Route path={AppRoutes.sources.match}>
|
||||||
{/* TODO: deprecated - "source" and "extension" page got merged into "browse" */}
|
{/* TODO: deprecated - "source" and "extension" page got merged into "browse" */}
|
||||||
<Route index element={<Navigate to={AppRoutes.browse.path(BrowseTab.SOURCES)} replace />} />
|
<Route index element={<Navigate to={AppRoutes.browse.path(BrowseTab.SOURCES)} replace />} />
|
||||||
<Route path={AppRoutes.sources.childRoutes.browse.match} element={<SourceMangas />} />
|
<Route path={AppRoutes.sources.children.browse.match} element={<SourceMangas />} />
|
||||||
<Route path={AppRoutes.sources.childRoutes.configure.match} element={<SourceConfigure />} />
|
<Route path={AppRoutes.sources.children.configure.match} element={<SourceConfigure />} />
|
||||||
<Route path={AppRoutes.sources.childRoutes.searchAll.match} element={<SearchAll />} />
|
<Route path={AppRoutes.sources.children.searchAll.match} element={<SearchAll />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={AppRoutes.extension.match}>
|
<Route path={AppRoutes.extension.match}>
|
||||||
{/* 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
|
index
|
||||||
element={<Navigate to={AppRoutes.browse.path(BrowseTab.EXTENSIONS)} replace />}
|
element={<Navigate to={AppRoutes.browse.path(BrowseTab.EXTENSIONS)} replace />}
|
||||||
/>
|
/>
|
||||||
<Route path={AppRoutes.extension.childRoutes.info.match} element={<ExtensionInfo />} />
|
<Route path={AppRoutes.extension.children.info.match} element={<ExtensionInfo />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={AppRoutes.downloads.match} element={<DownloadQueue />} />
|
<Route path={AppRoutes.downloads.match} element={<DownloadQueue />} />
|
||||||
<Route path={AppRoutes.manga.match}>
|
<Route path={AppRoutes.manga.match}>
|
||||||
<Route path={AppRoutes.manga.childRoutes.reader.match} element={null} />
|
<Route path={AppRoutes.manga.children.reader.match} element={null} />
|
||||||
<Route index element={<Manga />} />
|
<Route index element={<Manga />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={AppRoutes.library.match} element={<Library />} />
|
<Route path={AppRoutes.library.match} element={<Library />} />
|
||||||
@@ -364,12 +352,9 @@ const MainApp = () => {
|
|||||||
<Route path={AppRoutes.browse.match} element={<Browse />} />
|
<Route path={AppRoutes.browse.match} element={<Browse />} />
|
||||||
<Route path={AppRoutes.migrate.match}>
|
<Route path={AppRoutes.migrate.match}>
|
||||||
<Route index element={<Migration />} />
|
<Route index element={<Migration />} />
|
||||||
|
<Route path={AppRoutes.migrate.children.singleMangaSearch.match} element={<SearchAll />} />
|
||||||
<Route
|
<Route
|
||||||
path={AppRoutes.migrate.childRoutes.singleMangaSearch.match}
|
path={AppRoutes.migrate.children.manualSearch.match}
|
||||||
element={<SearchAll />}
|
|
||||||
/>
|
|
||||||
<Route
|
|
||||||
path={AppRoutes.migrate.childRoutes.manualSearch.match}
|
|
||||||
element={<MigrationManualSearch />}
|
element={<MigrationManualSearch />}
|
||||||
/>
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ type AppRouteInfo = {
|
|||||||
state?: (...args: any[]) => Record<string, unknown>;
|
state?: (...args: any[]) => Record<string, unknown>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type TAppRoutes = Record<string, AppRouteInfo & { childRoutes?: TAppRoutes }>;
|
type TAppRoutes = Record<string, AppRouteInfo & { children?: TAppRoutes }>;
|
||||||
|
|
||||||
export const AppRoutes = {
|
export const AppRoutes = {
|
||||||
root: {
|
root: {
|
||||||
@@ -35,7 +35,7 @@ export const AppRoutes = {
|
|||||||
authentication: {
|
authentication: {
|
||||||
match: 'auth',
|
match: 'auth',
|
||||||
path: '/auth',
|
path: '/auth',
|
||||||
childRoutes: {
|
children: {
|
||||||
login: {
|
login: {
|
||||||
match: 'login',
|
match: 'login',
|
||||||
path: '/auth/login',
|
path: '/auth/login',
|
||||||
@@ -49,7 +49,7 @@ export const AppRoutes = {
|
|||||||
settings: {
|
settings: {
|
||||||
match: 'settings',
|
match: 'settings',
|
||||||
path: '/settings',
|
path: '/settings',
|
||||||
childRoutes: {
|
children: {
|
||||||
categories: {
|
categories: {
|
||||||
match: 'categories',
|
match: 'categories',
|
||||||
path: '/settings/categories',
|
path: '/settings/categories',
|
||||||
@@ -62,7 +62,7 @@ export const AppRoutes = {
|
|||||||
match: 'library',
|
match: 'library',
|
||||||
path: '/settings/library',
|
path: '/settings/library',
|
||||||
|
|
||||||
childRoutes: {
|
children: {
|
||||||
duplicates: {
|
duplicates: {
|
||||||
match: 'duplicates',
|
match: 'duplicates',
|
||||||
path: '/settings/library/duplicates',
|
path: '/settings/library/duplicates',
|
||||||
@@ -72,7 +72,7 @@ export const AppRoutes = {
|
|||||||
download: {
|
download: {
|
||||||
match: 'download',
|
match: 'download',
|
||||||
path: '/settings/download',
|
path: '/settings/download',
|
||||||
childRoutes: {
|
children: {
|
||||||
// TODO: deprecated - got moved to "settings/images/processing/downloads"
|
// TODO: deprecated - got moved to "settings/images/processing/downloads"
|
||||||
conversions: {
|
conversions: {
|
||||||
match: 'conversions',
|
match: 'conversions',
|
||||||
@@ -83,7 +83,7 @@ export const AppRoutes = {
|
|||||||
images: {
|
images: {
|
||||||
match: 'images',
|
match: 'images',
|
||||||
path: '/settings/images',
|
path: '/settings/images',
|
||||||
childRoutes: {
|
children: {
|
||||||
processingDownloads: {
|
processingDownloads: {
|
||||||
match: 'processing/downloads',
|
match: 'processing/downloads',
|
||||||
path: '/settings/images/processing/downloads',
|
path: '/settings/images/processing/downloads',
|
||||||
@@ -131,7 +131,7 @@ export const AppRoutes = {
|
|||||||
sources: {
|
sources: {
|
||||||
match: 'sources',
|
match: 'sources',
|
||||||
path: '/sources',
|
path: '/sources',
|
||||||
childRoutes: {
|
children: {
|
||||||
browse: {
|
browse: {
|
||||||
match: ':sourceId',
|
match: ':sourceId',
|
||||||
path: (sourceId: SourceIdInfo['id'], query?: string | null | undefined) =>
|
path: (sourceId: SourceIdInfo['id'], query?: string | null | undefined) =>
|
||||||
@@ -151,11 +151,10 @@ export const AppRoutes = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
extension: {
|
extension: {
|
||||||
match: 'extension',
|
match: 'extension',
|
||||||
path: '/extension',
|
path: '/extension',
|
||||||
childRoutes: {
|
children: {
|
||||||
info: {
|
info: {
|
||||||
match: ':pkgName',
|
match: ':pkgName',
|
||||||
path: (pkgName: string) => `/extension/${pkgName}`,
|
path: (pkgName: string) => `/extension/${pkgName}`,
|
||||||
@@ -169,8 +168,7 @@ export const AppRoutes = {
|
|||||||
manga: {
|
manga: {
|
||||||
match: 'manga/:id',
|
match: 'manga/:id',
|
||||||
path: (mangaId: MangaIdInfo['id']) => `/manga/${mangaId}`,
|
path: (mangaId: MangaIdInfo['id']) => `/manga/${mangaId}`,
|
||||||
|
children: {
|
||||||
childRoutes: {
|
|
||||||
reader: {
|
reader: {
|
||||||
match: 'chapter/:chapterNum',
|
match: 'chapter/:chapterNum',
|
||||||
path: (mangaId: MangaIdInfo['id'], chapterNum: ChapterSourceOrderInfo['sourceOrder']) =>
|
path: (mangaId: MangaIdInfo['id'], chapterNum: ChapterSourceOrderInfo['sourceOrder']) =>
|
||||||
@@ -208,7 +206,7 @@ export const AppRoutes = {
|
|||||||
migrate: {
|
migrate: {
|
||||||
match: 'migrate/*',
|
match: 'migrate/*',
|
||||||
path: '/migrate',
|
path: '/migrate',
|
||||||
childRoutes: {
|
children: {
|
||||||
singleMangaSearch: {
|
singleMangaSearch: {
|
||||||
match: 'source/:sourceId/manga/:mangaId/search',
|
match: 'source/:sourceId/manga/:mangaId/search',
|
||||||
path: (sourceId: SourceIdInfo['id'], mangaId: MangaIdInfo['id'], query?: string | null | undefined) =>
|
path: (sourceId: SourceIdInfo['id'], mangaId: MangaIdInfo['id'], query?: string | null | undefined) =>
|
||||||
@@ -241,7 +239,7 @@ export const AppRoutes = {
|
|||||||
},
|
},
|
||||||
} as const satisfies TAppRoutes;
|
} as const satisfies TAppRoutes;
|
||||||
|
|
||||||
type ExtractChildRouteStringPaths<T> = T extends { childRoutes: infer U } ? ExtractStringPaths<U[keyof U]> : never;
|
type ExtractChildRouteStringPaths<T> = T extends { children: infer U } ? ExtractStringPaths<U[keyof U]> : never;
|
||||||
|
|
||||||
type ExtractStringPaths<T> = T extends { path: infer P }
|
type ExtractStringPaths<T> = T extends { path: infer P }
|
||||||
? P extends string
|
? P extends string
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export const BackupValidationDialog = ({
|
|||||||
<Button
|
<Button
|
||||||
onClick={onDismiss}
|
onClick={onDismiss}
|
||||||
component={Link}
|
component={Link}
|
||||||
to={AppRoutes.settings.childRoutes.tracking.path}
|
to={AppRoutes.settings.children.tracking.path}
|
||||||
autoFocus={!!validationResult?.missingTrackers.length}
|
autoFocus={!!validationResult?.missingTrackers.length}
|
||||||
variant={validationResult?.missingTrackers.length ? 'contained' : 'text'}
|
variant={validationResult?.missingTrackers.length ? 'contained' : 'text'}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ export function Extensions({ tabsMenuHeight }: { tabsMenuHeight: number }) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography>{t`You have to add a extension repository to be able to install extensions`}</Typography>
|
<Typography>{t`You have to add a extension repository to be able to install extensions`}</Typography>
|
||||||
<Button component={Link} variant="contained" to={AppRoutes.settings.childRoutes.browse.path}>
|
<Button component={Link} variant="contained" to={AppRoutes.settings.children.browse.path}>
|
||||||
{t`Settings`}
|
{t`Settings`}
|
||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ export function ExtensionCard(props: IProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
<OptionalCardActionAreaLink disabled={!isInstalled} to={AppRoutes.extension.childRoutes.info.path(pkgName)}>
|
<OptionalCardActionAreaLink disabled={!isInstalled} to={AppRoutes.extension.children.info.path(pkgName)}>
|
||||||
<ListCardContent>
|
<ListCardContent>
|
||||||
<ListCardAvatar
|
<ListCardAvatar
|
||||||
iconUrl={requestManager.getValidImgUrlFor(iconUrl)}
|
iconUrl={requestManager.getValidImgUrlFor(iconUrl)}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export function Sources({ tabsMenuHeight }: { tabsMenuHeight: number }) {
|
|||||||
useAppAction(
|
useAppAction(
|
||||||
<>
|
<>
|
||||||
<CustomTooltip title={t`Global Search`}>
|
<CustomTooltip title={t`Global Search`}>
|
||||||
<IconButton onClick={() => navigate(AppRoutes.sources.childRoutes.searchAll.path())} color="inherit">
|
<IconButton onClick={() => navigate(AppRoutes.sources.children.searchAll.path())} color="inherit">
|
||||||
<TravelExploreIcon />
|
<TravelExploreIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ export const SourceCard: React.FC<IProps> = (props: IProps) => {
|
|||||||
<Card>
|
<Card>
|
||||||
<CardActionArea
|
<CardActionArea
|
||||||
component={Link}
|
component={Link}
|
||||||
to={AppRoutes.sources.childRoutes.browse.path(id)}
|
to={AppRoutes.sources.children.browse.path(id)}
|
||||||
state={AppRoutes.sources.childRoutes.browse.state({
|
state={AppRoutes.sources.children.browse.state({
|
||||||
contentType: SourceContentType.POPULAR,
|
contentType: SourceContentType.POPULAR,
|
||||||
clearCache: true,
|
clearCache: true,
|
||||||
})}
|
})}
|
||||||
@@ -105,8 +105,8 @@ export const SourceCard: React.FC<IProps> = (props: IProps) => {
|
|||||||
{...MUIUtil.preventRippleProp()}
|
{...MUIUtil.preventRippleProp()}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
component={Link}
|
component={Link}
|
||||||
to={AppRoutes.sources.childRoutes.browse.path(id)}
|
to={AppRoutes.sources.children.browse.path(id)}
|
||||||
state={AppRoutes.sources.childRoutes.browse.state({
|
state={AppRoutes.sources.children.browse.state({
|
||||||
contentType: SourceContentType.LATEST,
|
contentType: SourceContentType.LATEST,
|
||||||
clearCache: true,
|
clearCache: true,
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -248,11 +248,7 @@ export function CategorySelect(props: CategorySelectProps) {
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button
|
<Button component={Link} to={AppRoutes.settings.children.categories.path} onClick={onDismiss}>
|
||||||
component={Link}
|
|
||||||
to={AppRoutes.settings.childRoutes.categories.path}
|
|
||||||
onClick={onDismiss}
|
|
||||||
>
|
|
||||||
{allCategories.length ? t`Edit` : t`Create`}
|
{allCategories.length ? t`Edit` : t`Create`}
|
||||||
</Button>
|
</Button>
|
||||||
<Stack direction="row">
|
<Stack direction="row">
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ export const DownloadSettings = () => {
|
|||||||
onChange={(e) => updateSetting('downloadAsCbz', e.target.checked)}
|
onChange={(e) => updateSetting('downloadAsCbz', e.target.checked)}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.images.childRoutes.processingDownloads.path}>
|
<ListItemLink to={AppRoutes.settings.children.images.children.processingDownloads.path}>
|
||||||
<ListItemText primary={t`Image download processing`} />
|
<ListItemText primary={t`Image download processing`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<List
|
<List
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export const SourceCard = (source: SourceIdInfo & SourceLanguageInfo & SourceCon
|
|||||||
<CustomTooltip title={t`Settings`}>
|
<CustomTooltip title={t`Settings`}>
|
||||||
<IconButton
|
<IconButton
|
||||||
component={Link}
|
component={Link}
|
||||||
to={AppRoutes.sources.childRoutes.configure.path(id)}
|
to={AppRoutes.sources.children.configure.path(id)}
|
||||||
color="inherit"
|
color="inherit"
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
{...MUIUtil.preventRippleProp()}
|
{...MUIUtil.preventRippleProp()}
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ const SourceSearchPreview = React.memo(
|
|||||||
<Card sx={{ mb: 1 }}>
|
<Card sx={{ mb: 1 }}>
|
||||||
<CardActionArea
|
<CardActionArea
|
||||||
component={Link}
|
component={Link}
|
||||||
to={AppRoutes.sources.childRoutes.browse.path(id, searchString)}
|
to={AppRoutes.sources.children.browse.path(id, searchString)}
|
||||||
sx={{ p: 1, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}
|
sx={{ p: 1, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}
|
||||||
>
|
>
|
||||||
<Box>
|
<Box>
|
||||||
@@ -376,7 +376,7 @@ export const SearchAll = ({
|
|||||||
replace: true,
|
replace: true,
|
||||||
state: {
|
state: {
|
||||||
...state,
|
...state,
|
||||||
...AppRoutes.sources.childRoutes.searchAll.state({
|
...AppRoutes.sources.children.searchAll.state({
|
||||||
shouldShowOnlyPinnedSources: true,
|
shouldShowOnlyPinnedSources: true,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
@@ -399,7 +399,7 @@ export const SearchAll = ({
|
|||||||
replace: true,
|
replace: true,
|
||||||
state: {
|
state: {
|
||||||
...state,
|
...state,
|
||||||
...AppRoutes.sources.childRoutes.searchAll.state({
|
...AppRoutes.sources.children.searchAll.state({
|
||||||
shouldShowOnlyPinnedSources: false,
|
shouldShowOnlyPinnedSources: false,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ export function Library() {
|
|||||||
<Button
|
<Button
|
||||||
size="large"
|
size="large"
|
||||||
component={Link}
|
component={Link}
|
||||||
to={AppRoutes.sources.childRoutes.searchAll.path(query)}
|
to={AppRoutes.sources.children.searchAll.path(query)}
|
||||||
sx={{ textTransform: 'none', width: '100%' }}
|
sx={{ textTransform: 'none', width: '100%' }}
|
||||||
>
|
>
|
||||||
{t`Search for "${query}" globally`}
|
{t`Search for "${query}" globally`}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ export function LibrarySettings() {
|
|||||||
</ListSubheader>
|
</ListSubheader>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.categories.path}>
|
<ListItemLink to={AppRoutes.settings.children.categories.path}>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={t`Edit categories`}
|
primary={t`Edit categories`}
|
||||||
secondary={plural(categoryCount, {
|
secondary={plural(categoryCount, {
|
||||||
@@ -197,7 +197,7 @@ export function LibrarySettings() {
|
|||||||
secondary={t`Remove non library manga from categories`}
|
secondary={t`Remove non library manga from categories`}
|
||||||
/>
|
/>
|
||||||
</ListItemButton>
|
</ListItemButton>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.library.childRoutes.duplicates.path}>
|
<ListItemLink to={AppRoutes.settings.children.library.children.duplicates.path}>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={t`Duplicated entries`}
|
primary={t`Duplicated entries`}
|
||||||
secondary={t`Show all duplicated entries in your library`}
|
secondary={t`Show all duplicated entries in your library`}
|
||||||
|
|||||||
@@ -89,12 +89,12 @@ export const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
|
|||||||
<>
|
<>
|
||||||
<CustomTooltip title={t`Migrate`}>
|
<CustomTooltip title={t`Migrate`}>
|
||||||
<Link
|
<Link
|
||||||
to={AppRoutes.migrate.childRoutes.singleMangaSearch.path(
|
to={AppRoutes.migrate.children.singleMangaSearch.path(
|
||||||
manga.sourceId,
|
manga.sourceId,
|
||||||
manga.id,
|
manga.id,
|
||||||
manga.title,
|
manga.title,
|
||||||
)}
|
)}
|
||||||
state={AppRoutes.migrate.childRoutes.singleMangaSearch.state({
|
state={AppRoutes.migrate.children.singleMangaSearch.state({
|
||||||
title: t`Migrate "${manga.title}"`,
|
title: t`Migrate "${manga.title}"`,
|
||||||
})}
|
})}
|
||||||
style={{ textDecoration: 'none', color: 'inherit' }}
|
style={{ textDecoration: 'none', color: 'inherit' }}
|
||||||
@@ -165,12 +165,12 @@ export const MangaToolbarMenu = ({ manga, onRefresh, refreshing }: IProps) => {
|
|||||||
<MenuItem
|
<MenuItem
|
||||||
key="migrate"
|
key="migrate"
|
||||||
component={Link}
|
component={Link}
|
||||||
to={AppRoutes.migrate.childRoutes.singleMangaSearch.path(
|
to={AppRoutes.migrate.children.singleMangaSearch.path(
|
||||||
manga.sourceId,
|
manga.sourceId,
|
||||||
manga.id,
|
manga.id,
|
||||||
manga.title,
|
manga.title,
|
||||||
)}
|
)}
|
||||||
state={AppRoutes.migrate.childRoutes.singleMangaSearch.state({
|
state={AppRoutes.migrate.children.singleMangaSearch.state({
|
||||||
title: t`Migrate "${manga.title}"`,
|
title: t`Migrate "${manga.title}"`,
|
||||||
})}
|
})}
|
||||||
style={{ textDecoration: 'none', color: 'inherit' }}
|
style={{ textDecoration: 'none', color: 'inherit' }}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export const TrackMangaButton = ({ manga }: { manga: MangaTrackRecordInfo & Mang
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!loggedInTrackers.length) {
|
if (!loggedInTrackers.length) {
|
||||||
navigate(AppRoutes.settings.childRoutes.tracking.path);
|
navigate(AppRoutes.settings.children.tracking.path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const getMangaLinkTo = (
|
|||||||
case 'duplicate':
|
case 'duplicate':
|
||||||
return AppRoutes.manga.path(mangaId);
|
return AppRoutes.manga.path(mangaId);
|
||||||
case 'migrate.search':
|
case 'migrate.search':
|
||||||
return AppRoutes.migrate.childRoutes.singleMangaSearch.path(sourceId ?? '-1', mangaId, mangaTitle);
|
return AppRoutes.migrate.children.singleMangaSearch.path(sourceId ?? '-1', mangaId, mangaTitle);
|
||||||
case 'migrate.select':
|
case 'migrate.select':
|
||||||
return '';
|
return '';
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ export const SearchLink = ({
|
|||||||
const link = (() => {
|
const link = (() => {
|
||||||
const isSourceMode = mode === 'source' && sourceId !== undefined;
|
const isSourceMode = mode === 'source' && sourceId !== undefined;
|
||||||
if (isSourceMode) {
|
if (isSourceMode) {
|
||||||
return AppRoutes.sources.childRoutes.browse.path(sourceId, query);
|
return AppRoutes.sources.children.browse.path(sourceId, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode === 'source.global-search') {
|
if (mode === 'source.global-search') {
|
||||||
return AppRoutes.sources.childRoutes.searchAll.path(query);
|
return AppRoutes.sources.children.searchAll.path(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
return AppRoutes.library.path(undefined, query);
|
return AppRoutes.library.path(undefined, query);
|
||||||
|
|||||||
@@ -319,9 +319,9 @@ export class MigrationManager {
|
|||||||
const [manga] = mangas;
|
const [manga] = mangas;
|
||||||
|
|
||||||
ReactRouter.navigate(
|
ReactRouter.navigate(
|
||||||
AppRoutes.migrate.childRoutes.singleMangaSearch.path(manga.sourceId, manga.id, manga.title),
|
AppRoutes.migrate.children.singleMangaSearch.path(manga.sourceId, manga.id, manga.title),
|
||||||
{
|
{
|
||||||
state: AppRoutes.migrate.childRoutes.singleMangaSearch.state({
|
state: AppRoutes.migrate.children.singleMangaSearch.state({
|
||||||
title: t`Migrate "${manga.title}"`,
|
title: t`Migrate "${manga.title}"`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
@@ -671,7 +671,7 @@ export class MigrationManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static openManualSearch(mangaId: MangaIdInfo['id'], title: string): void {
|
static openManualSearch(mangaId: MangaIdInfo['id'], title: string): void {
|
||||||
ReactRouter.navigate(AppRoutes.migrate.childRoutes.manualSearch.path(mangaId, title), {
|
ReactRouter.navigate(AppRoutes.migrate.children.manualSearch.path(mangaId, title), {
|
||||||
state: AppRoutes.migrate.children.manualSearch.state({
|
state: AppRoutes.migrate.children.manualSearch.state({
|
||||||
title: t`Manual migration search for "${title}"`,
|
title: t`Manual migration search for "${title}"`,
|
||||||
mode: 'migrate.select.bulk',
|
mode: 'migrate.select.bulk',
|
||||||
|
|||||||
@@ -53,10 +53,10 @@ export const ImagesSettings = () => {
|
|||||||
</ListSubheader>
|
</ListSubheader>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.images.childRoutes.processingDownloads.path}>
|
<ListItemLink to={AppRoutes.settings.children.images.children.processingDownloads.path}>
|
||||||
<ListItemText primary={t`Image download processing`} />
|
<ListItemText primary={t`Image download processing`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.images.childRoutes.processingServe.path}>
|
<ListItemLink to={AppRoutes.settings.children.images.children.processingServe.path}>
|
||||||
<ListItemText primary={t`Image serve processing`} />
|
<ListItemText primary={t`Image serve processing`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
</List>
|
</List>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export const More = () => {
|
|||||||
const hiddenItemsMoreGroup = [
|
const hiddenItemsMoreGroup = [
|
||||||
...(hiddenNavBarItemsByMoreGroup[NavBarItemMoreGroup.HIDDEN_ITEM] ?? STABLE_EMPTY_ARRAY),
|
...(hiddenNavBarItemsByMoreGroup[NavBarItemMoreGroup.HIDDEN_ITEM] ?? STABLE_EMPTY_ARRAY),
|
||||||
{
|
{
|
||||||
path: AppRoutes.settings.childRoutes.categories.path,
|
path: AppRoutes.settings.children.categories.path,
|
||||||
title: msg`Categories`,
|
title: msg`Categories`,
|
||||||
SelectedIconComponent: ListAltIcon,
|
SelectedIconComponent: ListAltIcon,
|
||||||
IconComponent: ListAltIcon,
|
IconComponent: ListAltIcon,
|
||||||
|
|||||||
@@ -33,73 +33,73 @@ export function Settings() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<List sx={{ padding: 0 }}>
|
<List sx={{ padding: 0 }}>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.appearance.path}>
|
<ListItemLink to={AppRoutes.settings.children.appearance.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<PaletteIcon />
|
<PaletteIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`Appearance`} />
|
<ListItemText primary={t`Appearance`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.reader.path}>
|
<ListItemLink to={AppRoutes.settings.children.reader.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<AutoStoriesIcon />
|
<AutoStoriesIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`Reader`} />
|
<ListItemText primary={t`Reader`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.library.path}>
|
<ListItemLink to={AppRoutes.settings.children.library.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<CollectionsOutlinedBookmarkIcon />
|
<CollectionsOutlinedBookmarkIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`Library`} />
|
<ListItemText primary={t`Library`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.download.path}>
|
<ListItemLink to={AppRoutes.settings.children.download.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<GetAppOutlinedIcon />
|
<GetAppOutlinedIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`Downloads`} />
|
<ListItemText primary={t`Downloads`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.images.path}>
|
<ListItemLink to={AppRoutes.settings.children.images.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<ImageIcon />
|
<ImageIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`Images`} />
|
<ListItemText primary={t`Images`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.tracking.path}>
|
<ListItemLink to={AppRoutes.settings.children.tracking.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<SyncIcon />
|
<SyncIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`Tracking`} />
|
<ListItemText primary={t`Tracking`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.backup.path}>
|
<ListItemLink to={AppRoutes.settings.children.backup.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<BackupIcon />
|
<BackupIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`Backup`} />
|
<ListItemText primary={t`Backup`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.browse.path}>
|
<ListItemLink to={AppRoutes.settings.children.browse.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<ExploreOutlinedIcon />
|
<ExploreOutlinedIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`Browse`} />
|
<ListItemText primary={t`Browse`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.history.path}>
|
<ListItemLink to={AppRoutes.settings.children.history.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<HistoryIcon />
|
<HistoryIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`History`} />
|
<ListItemText primary={t`History`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.device.path}>
|
<ListItemLink to={AppRoutes.settings.children.device.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<DevicesIcon />
|
<DevicesIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`Device`} />
|
<ListItemText primary={t`Device`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.webui.path}>
|
<ListItemLink to={AppRoutes.settings.children.webui.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<WebIcon />
|
<WebIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={t`WebUI`} />
|
<ListItemText primary={t`WebUI`} />
|
||||||
</ListItemLink>
|
</ListItemLink>
|
||||||
<ListItemLink to={AppRoutes.settings.childRoutes.server.path}>
|
<ListItemLink to={AppRoutes.settings.children.server.path}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<DnsIcon />
|
<DnsIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ export function SourceMangas() {
|
|||||||
{
|
{
|
||||||
state: {
|
state: {
|
||||||
...locationState,
|
...locationState,
|
||||||
...AppRoutes.sources.childRoutes.browse.state({ contentType: newContentType }),
|
...AppRoutes.sources.children.browse.state({ contentType: newContentType }),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -430,7 +430,7 @@ export function SourceMangas() {
|
|||||||
{source?.isConfigurable && (
|
{source?.isConfigurable && (
|
||||||
<CustomTooltip title={t`Settings`}>
|
<CustomTooltip title={t`Settings`}>
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() => navigate(AppRoutes.sources.childRoutes.configure.path(sourceId))}
|
onClick={() => navigate(AppRoutes.sources.children.configure.path(sourceId))}
|
||||||
aria-label="display more actions"
|
aria-label="display more actions"
|
||||||
edge="end"
|
edge="end"
|
||||||
color="inherit"
|
color="inherit"
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export const TrackManga = ({ manga }: { manga: MangaIdInfo & MangaTitleInfo }) =
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!loading && !error && !trackersInUse.length && !loggedInTrackers.length) {
|
if (!loading && !error && !trackersInUse.length && !loggedInTrackers.length) {
|
||||||
navigate(AppRoutes.settings.childRoutes.tracking.path);
|
navigate(AppRoutes.settings.children.tracking.path);
|
||||||
}
|
}
|
||||||
}, [loading]);
|
}, [loading]);
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const TrackerOAuthLogin = () => {
|
|||||||
makeToast(t`Could not log in to ${trackerName}`, 'error', getErrorMessage(e));
|
makeToast(t`Could not log in to ${trackerName}`, 'error', getErrorMessage(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
navigate(AppRoutes.settings.childRoutes.tracking.path, { replace: true });
|
navigate(AppRoutes.settings.children.tracking.path, { replace: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
login();
|
login();
|
||||||
|
|||||||
Reference in New Issue
Block a user