{(topic) => (
<>
- 0,
+ value: isOwnerSubscribed(topic.slug),
+ }}
+ showStat={true}
/>
-
-
- {t('shoutsWithCount', { count: topic.stat.shouts })}
-
-
- {t('authorsWithCount', { count: topic.stat.authors })}
-
-
- {t('followersWithCount', { count: topic.stat.followers })}
-
-
>
)}
diff --git a/src/components/Views/AllTopics/index.ts b/src/components/Views/AllTopics/index.ts
new file mode 100644
index 00000000..8e3c8f84
--- /dev/null
+++ b/src/components/Views/AllTopics/index.ts
@@ -0,0 +1 @@
+export { AllTopics } from './AllTopics'
diff --git a/src/components/Views/Author/Author.tsx b/src/components/Views/Author/Author.tsx
index 1d8d8f7b..bb62322c 100644
--- a/src/components/Views/Author/Author.tsx
+++ b/src/components/Views/Author/Author.tsx
@@ -128,7 +128,6 @@ export const AuthorView = (props: Props) => {
const data = await apiClient.getReactionsBy({
by: { comment: false, created_by: commenter.id },
})
- console.debug('[components.Author] fetched comments', data)
setCommented(data)
}
diff --git a/src/context/following.tsx b/src/context/following.tsx
index 599b30a0..b7a5ab0d 100644
--- a/src/context/following.tsx
+++ b/src/context/following.tsx
@@ -20,7 +20,7 @@ interface FollowingContextType {
loadSubscriptions: () => void
follow: (what: FollowingEntity, slug: string) => Promise
unfollow: (what: FollowingEntity, slug: string) => Promise
- isOwnerSubscribed: (userId: number) => boolean
+ isOwnerSubscribed: (id: number | string) => boolean
}
const FollowingContext = createContext()
@@ -109,9 +109,11 @@ export const FollowingProvider = (props: { children: JSX.Element }) => {
}
}
- const isOwnerSubscribed = (userId: number) => {
- if (!author()) return
- return !!subscriptions?.authors?.some((authorEntity) => authorEntity.id === userId)
+ const isOwnerSubscribed = (id?: number | string) => {
+ if (!author() || !subscriptions) return
+ const isAuthorSubscribed = subscriptions.authors?.some((authorEntity) => authorEntity.id === id)
+ const isTopicSubscribed = subscriptions.topics?.some((topicEntity) => topicEntity.slug === id)
+ return !!isAuthorSubscribed || !!isTopicSubscribed
}
const value: FollowingContextType = {
diff --git a/src/pages/allTopics.page.tsx b/src/pages/allTopics.page.tsx
index fa2daa37..49d54626 100644
--- a/src/pages/allTopics.page.tsx
+++ b/src/pages/allTopics.page.tsx
@@ -2,7 +2,7 @@ import type { PageProps } from './types'
import { createSignal, onMount } from 'solid-js'
-import { AllTopicsView } from '../components/Views/AllTopics'
+import { AllTopics } from '../components/Views/AllTopics'
import { PageLayout } from '../components/_shared/PageLayout'
import { useLocalize } from '../context/localize'
import { loadAllTopics } from '../stores/zine/topics'
@@ -23,7 +23,7 @@ export const AllTopicsPage = (props: PageProps) => {
return (
-
+
)
}
diff --git a/src/pages/types.ts b/src/pages/types.ts
index b36a7612..05fd3f61 100644
--- a/src/pages/types.ts
+++ b/src/pages/types.ts
@@ -50,4 +50,9 @@ export type UploadedFile = {
originalFilename?: string
}
+export type FollowedInfo = {
+ value?: boolean
+ loaded?: boolean
+}
+
export type SubscriptionFilter = 'all' | 'authors' | 'topics' | 'communities'