Trigger global search on manga title click
This commit is contained in:
@@ -185,7 +185,7 @@ const SearchLink = ({
|
|||||||
}: {
|
}: {
|
||||||
query: string;
|
query: string;
|
||||||
sourceId: SourceIdInfo['id'] | undefined;
|
sourceId: SourceIdInfo['id'] | undefined;
|
||||||
mode: MangaLocationState['mode'];
|
mode: MangaLocationState['mode'] | 'source.global-search';
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
}) => {
|
}) => {
|
||||||
const link = (() => {
|
const link = (() => {
|
||||||
@@ -194,6 +194,10 @@ const SearchLink = ({
|
|||||||
return AppRoutes.sources.childRoutes.browse.path(sourceId, query);
|
return AppRoutes.sources.childRoutes.browse.path(sourceId, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mode === 'source.global-search') {
|
||||||
|
return AppRoutes.sources.childRoutes.searchAll.path(query);
|
||||||
|
}
|
||||||
|
|
||||||
return AppRoutes.library.path(undefined, query);
|
return AppRoutes.library.path(undefined, query);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -471,9 +475,11 @@ export const MangaDetails = ({
|
|||||||
<Thumbnail manga={manga} mangaDynamicColorSchemes={mangaDynamicColorSchemes} />
|
<Thumbnail manga={manga} mangaDynamicColorSchemes={mangaDynamicColorSchemes} />
|
||||||
<MetadataContainer>
|
<MetadataContainer>
|
||||||
<Stack sx={{ flexDirection: 'row', gap: 1, alignItems: 'flex-start', mb: 1 }}>
|
<Stack sx={{ flexDirection: 'row', gap: 1, alignItems: 'flex-start', mb: 1 }}>
|
||||||
|
<SearchLink query={manga.title} sourceId={manga.sourceId} mode="source.global-search">
|
||||||
<Typography variant="h5" component="h2" sx={{ wordBreak: 'break-word' }}>
|
<Typography variant="h5" component="h2" sx={{ wordBreak: 'break-word' }}>
|
||||||
{manga.title}
|
{manga.title}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
</SearchLink>
|
||||||
<CustomTooltip title={t('global.button.copy')}>
|
<CustomTooltip title={t('global.button.copy')}>
|
||||||
<IconButton onClick={copyTitle} color="inherit">
|
<IconButton onClick={copyTitle} color="inherit">
|
||||||
<ContentCopyIcon fontSize="small" />
|
<ContentCopyIcon fontSize="small" />
|
||||||
|
|||||||
Reference in New Issue
Block a user