Fix missing repost ribbon for Tags

Ribbon:
- hide: category pages, except Wild West
- show: Following, Tags, Wild West
This commit is contained in:
infinite-persistence 2022-04-25 09:42:46 +08:00
parent a6106f7427
commit 20b5653f95
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -54,6 +54,7 @@ function DiscoverPage(props: Props) {
const isHovering = useHover(buttonRef); const isHovering = useHover(buttonRef);
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const isWildWest = dynamicRouteProps && dynamicRouteProps.id === 'WILD_WEST'; const isWildWest = dynamicRouteProps && dynamicRouteProps.id === 'WILD_WEST';
const isCategory = Boolean(dynamicRouteProps);
const urlParams = new URLSearchParams(search); const urlParams = new URLSearchParams(search);
const langParam = urlParams.get(CS.LANGUAGE_KEY) || null; const langParam = urlParams.get(CS.LANGUAGE_KEY) || null;
@ -61,7 +62,7 @@ function DiscoverPage(props: Props) {
const tagsQuery = urlParams.get('t') || null; const tagsQuery = urlParams.get('t') || null;
const tags = tagsQuery ? tagsQuery.split(',') : null; const tags = tagsQuery ? tagsQuery.split(',') : null;
const repostedClaimIsResolved = repostedUri && repostedClaim; const repostedClaimIsResolved = repostedUri && repostedClaim;
const hideRepostRibbon = !isWildWest; const hideRepostRibbon = isCategory && !isWildWest;
// Eventually allow more than one tag on this page // Eventually allow more than one tag on this page
// Restricting to one to make follow/unfollow simpler // Restricting to one to make follow/unfollow simpler