From 41b5560036d663a48277b38fb9475b4316398ad4 Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Mon, 25 Dec 2023 16:07:12 +0100 Subject: [PATCH] random topic fixes (#348) --- src/components/Views/Home.module.scss | 1 - src/components/Views/Home.tsx | 3 ++- src/pages/topic.page.server.ts | 2 +- src/pages/topic.page.tsx | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/Views/Home.module.scss b/src/components/Views/Home.module.scss index 0f44ea68..b4a4ae37 100644 --- a/src/components/Views/Home.module.scss +++ b/src/components/Views/Home.module.scss @@ -9,7 +9,6 @@ font-size: 40px; font-weight: 700; line-height: 44px; - text-transform: capitalize; } .randomTopicHeaderLink { diff --git a/src/components/Views/Home.tsx b/src/components/Views/Home.tsx index ab13db72..137724cb 100644 --- a/src/components/Views/Home.tsx +++ b/src/components/Views/Home.tsx @@ -14,6 +14,7 @@ import { import { useTopAuthorsStore } from '../../stores/zine/topAuthors' import { useTopicsStore } from '../../stores/zine/topics' import { apiClient } from '../../utils/apiClient' +import { capitalize } from '../../utils/capitalize' import { restoreScrollPosition, saveScrollPosition } from '../../utils/scroll' import { splitToPages } from '../../utils/splitToPages' import { Icon } from '../_shared/Icon' @@ -134,7 +135,7 @@ export const HomeView = (props: Props) => { articles={randomTopicArticles()} header={
-
{randomTopic().title}
+
{capitalize(randomTopic().title, true)}
{ } const topicShouts = await apiClient.getShouts({ - filters: { topic: topic.slug }, + filters: { topic: topic.slug, visibility: 'public' }, limit: PRERENDERED_ARTICLES_COUNT, }) diff --git a/src/pages/topic.page.tsx b/src/pages/topic.page.tsx index 573a3605..424e927b 100644 --- a/src/pages/topic.page.tsx +++ b/src/pages/topic.page.tsx @@ -20,7 +20,11 @@ export const TopicPage = (props: PageProps) => { const preload = () => Promise.all([ - loadShouts({ filters: { topic: slug() }, limit: PRERENDERED_ARTICLES_COUNT, offset: 0 }), + loadShouts({ + filters: { topic: slug(), visibility: 'public' }, + limit: PRERENDERED_ARTICLES_COUNT, + offset: 0, + }), loadTopic({ slug: slug() }), ])