From 1642109433666ab1a5361abdca7f499e29f2be33 Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 13 Jan 2024 17:26:21 +0300 Subject: [PATCH] badge-fix --- src/components/Author/AuthorBadge/AuthorBadge.tsx | 7 +++---- src/components/Topic/TopicBadge/TopicBadge.tsx | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/Author/AuthorBadge/AuthorBadge.tsx b/src/components/Author/AuthorBadge/AuthorBadge.tsx index 80e32c73..39624854 100644 --- a/src/components/Author/AuthorBadge/AuthorBadge.tsx +++ b/src/components/Author/AuthorBadge/AuthorBadge.tsx @@ -42,10 +42,9 @@ export const AuthorBadge = (props: Props) => { } = useSession() const { changeSearchParams } = useRouter() const { t, formatDate, lang } = useLocalize() - const subscribed = createMemo(() => { - let sss = subscriptions() - return sss?.authors.some((a: Author) => a?.slug === props.author.slug) - }) + const subscribed = createMemo( + () => subscriptions()?.authors.some((a: Author) => a?.slug === props.author.slug), + ) const subscribe = async (really = true) => { setIsSubscribing(true) diff --git a/src/components/Topic/TopicBadge/TopicBadge.tsx b/src/components/Topic/TopicBadge/TopicBadge.tsx index 4159da6d..baa410b6 100644 --- a/src/components/Topic/TopicBadge/TopicBadge.tsx +++ b/src/components/Topic/TopicBadge/TopicBadge.tsx @@ -6,14 +6,12 @@ import { useMediaQuery } from '../../../context/mediaQuery' import { useSession } from '../../../context/session' import { FollowingEntity, Topic } from '../../../graphql/schema/core.gen' import { follow, unfollow } from '../../../stores/zine/common' +import { capitalize } from '../../../utils/capitalize' import { getImageUrl } from '../../../utils/getImageUrl' import { Button } from '../../_shared/Button' import { CheckButton } from '../../_shared/CheckButton' import styles from './TopicBadge.module.scss' -import { title } from 'process' -import { capitalize } from '../../../utils/capitalize' - type Props = { topic: Topic minimizeSubscribeButton?: boolean