From 84f45ea1a2d727fe17c428f049651444a71b70d9 Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Tue, 13 Sep 2022 15:38:26 +0200 Subject: [PATCH] review fixes --- src/components/Topic/Card.tsx | 2 -- src/components/Views/Author.tsx | 7 +++++-- src/components/Views/Feed.tsx | 5 +++-- src/components/Views/Home.tsx | 1 + src/components/Views/Search.tsx | 5 +---- src/graphql/mutation/my-session.ts | 2 +- src/pages/author/[slug]/index.astro | 2 ++ src/stores/ui.ts | 2 +- src/stores/zine/authors.ts | 8 ++++++-- src/stores/zine/common.ts | 1 + src/stores/zine/topics.ts | 9 +++++++-- src/utils/apiClient.ts | 3 ++- src/utils/sortby.ts | 1 + 13 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/components/Topic/Card.tsx b/src/components/Topic/Card.tsx index cbf85556..1bebbb9a 100644 --- a/src/components/Topic/Card.tsx +++ b/src/components/Topic/Card.tsx @@ -32,10 +32,8 @@ export const TopicCard = (props: TopicProps) => { const subscribe = async (really = true) => { if (really) { follow({ what: FollowingEntity.Topic, slug: topic().slug }) - // TODO: setSubscribers(topic().stat?.followers as number + 1) } else { unfollow({ what: FollowingEntity.Topic, slug: topic().slug }) - // TODO: setSubscribers(topic().stat?.followers as number - 1) } } return ( diff --git a/src/components/Views/Author.tsx b/src/components/Views/Author.tsx index bdb11661..59ce7e66 100644 --- a/src/components/Views/Author.tsx +++ b/src/components/Views/Author.tsx @@ -1,5 +1,5 @@ import { Show, createMemo } from 'solid-js' -import type { Author, Shout } from '../../graphql/types.gen' +import type { Author, Reaction, Shout } from '../../graphql/types.gen' import Row2 from '../Feed/Row2' import Row3 from '../Feed/Row3' import Beside from '../Feed/Beside' @@ -13,13 +13,16 @@ import '../../styles/Topic.scss' import { useStore } from '@nanostores/solid' import { useTopicsStore } from '../../stores/zine/topics' +// TODO: load reactions on client type AuthorProps = { authorArticles: Shout[] author: Author + // FIXME author topics fro server + // topics: Topic[] } export const AuthorPage = (props: AuthorProps) => { - const { getSortedArticles: articles, getArticlesByAuthor } = useArticlesStore({ + const { getSortedArticles: articles } = useArticlesStore({ sortedArticles: props.authorArticles }) const { getAuthorEntities: authors } = useAuthorsStore({ authors: [props.author] }) diff --git a/src/components/Views/Feed.tsx b/src/components/Views/Feed.tsx index 83fcff65..b983f0b1 100644 --- a/src/components/Views/Feed.tsx +++ b/src/components/Views/Feed.tsx @@ -55,6 +55,7 @@ export const FeedPage = (props: FeedProps) => { // }) const loadMore = () => { + // FIXME const page = (props.page || 1) + 1 loadRecentArticles({ page }) } @@ -98,7 +99,7 @@ export const FeedPage = (props: FeedProps) => {