Streamline route location state
This commit is contained in:
@@ -18,7 +18,6 @@ import PushPinOutlinedIcon from '@mui/icons-material/PushPinOutlined';
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { SourceContentType } from '@/features/source/browse/screens/SourceMangas.tsx';
|
||||
import type { GetSourcesListQuery } from '@/lib/graphql/generated/graphql.ts';
|
||||
import { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { MUIUtil } from '@/lib/mui/MUI.util.ts';
|
||||
@@ -30,6 +29,7 @@ import { createUpdateSourceMetadata, useGetSourceMetadata } from '@/features/sou
|
||||
import { makeToast } from '@/base/utils/Toast.ts';
|
||||
import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
||||
import { languageCodeToName } from '@/base/utils/Languages.ts';
|
||||
import { SourceContentType } from '@/features/source/Source.types.ts';
|
||||
|
||||
interface IProps {
|
||||
source: GetSourcesListQuery['sources']['nodes'][number];
|
||||
@@ -64,7 +64,10 @@ export const SourceCard: React.FC<IProps> = (props: IProps) => {
|
||||
<CardActionArea
|
||||
component={Link}
|
||||
to={AppRoutes.sources.childRoutes.browse.path(id)}
|
||||
state={{ contentType: SourceContentType.POPULAR, clearCache: true }}
|
||||
state={AppRoutes.sources.childRoutes.browse.state({
|
||||
contentType: SourceContentType.POPULAR,
|
||||
clearCache: true,
|
||||
})}
|
||||
>
|
||||
<ListCardContent>
|
||||
<ListCardAvatar
|
||||
@@ -103,7 +106,10 @@ export const SourceCard: React.FC<IProps> = (props: IProps) => {
|
||||
variant="outlined"
|
||||
component={Link}
|
||||
to={AppRoutes.sources.childRoutes.browse.path(id)}
|
||||
state={{ contentType: SourceContentType.LATEST, clearCache: true }}
|
||||
state={AppRoutes.sources.childRoutes.browse.state({
|
||||
contentType: SourceContentType.LATEST,
|
||||
clearCache: true,
|
||||
})}
|
||||
>
|
||||
{t`Latest`}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user