diff --git a/src/components/Views/Topic.tsx b/src/components/Views/Topic.tsx
index 3d7ae3f3..8579a739 100644
--- a/src/components/Views/Topic.tsx
+++ b/src/components/Views/Topic.tsx
@@ -1,4 +1,11 @@
-import { Author, LoadShoutsOptions, Shout, Topic } from '../../graphql/schema/core.gen'
+import {
+ Author,
+ AuthorsBy,
+ LoadShoutsOptions,
+ QueryLoad_Authors_ByArgs,
+ Shout,
+ Topic,
+} from '../../graphql/schema/core.gen'
import { clsx } from 'clsx'
import { For, Show, createEffect, createMemo, createSignal, on, onMount } from 'solid-js'
@@ -87,6 +94,12 @@ export const TopicView = (props: Props) => {
setReactedTopMonthArticles(result)
}
+ const [topicAuthors, setTopicAuthors] = createSignal
([])
+ const loadTopicAuthors = async () => {
+ const by: AuthorsBy = { topic: props.topicSlug }
+ const result = await apiClient.loadAuthorsBy({ by })
+ setTopicAuthors(result)
+ }
const loadRandom = () => {
loadFavoriteTopArticles(topic()?.slug)
@@ -98,6 +111,7 @@ export const TopicView = (props: Props) => {
() => topic()?.id,
(_) => {
loadTopicFollowers()
+ loadTopicAuthors()
loadRandom()
},
{ defer: true },
@@ -167,7 +181,7 @@ export const TopicView = (props: Props) => {
-
+
diff --git a/src/components/_shared/Subscribers/Subscribers.tsx b/src/components/_shared/Subscribers/Subscribers.tsx
index e418f37f..97a5afc7 100644
--- a/src/components/_shared/Subscribers/Subscribers.tsx
+++ b/src/components/_shared/Subscribers/Subscribers.tsx
@@ -8,8 +8,10 @@ import { Userpic } from '../../Author/Userpic'
import styles from './Subscribers.module.scss'
type Props = {
- followers: Author[]
+ followers?: Author[]
+ followersAmount?: number
following?: Array
+ followingAmount?: number
}
export const Subscribers = (props: Props) => {
@@ -17,21 +19,21 @@ export const Subscribers = (props: Props) => {
return (
-
0}>
-
+
+ 0}>
{(f) => }
-
- {t('SubscriberWithCount', {
- count: props.followers.length ?? 0,
- })}
-
-
-
+
+
+ {t('SubscriberWithCount', {
+ count: props.followersAmount || props.followers.length || 0,
+ })}
+
+
-
0}>
-
+
+ 0}>
{(f) => {
if ('name' in f) {
@@ -45,13 +47,13 @@ export const Subscribers = (props: Props) => {
return null
}}
-
- {t('SubscriptionWithCount', {
- count: props?.following.length ?? 0,
- })}
-
-
-
+
+
+ {t('SubscriptionWithCount', {
+ count: props.followingAmount || props.following?.length || 0,
+ })}
+
+
)
}