From 9483b84bade9c546512d505219e0ea803aac1e3e Mon Sep 17 00:00:00 2001 From: Alexey Khaov Date: Wed, 25 Jan 2023 01:15:29 +0300 Subject: [PATCH] Hide articles dates on the main page --- src/components/Feed/Beside.tsx | 11 +++++++-- src/components/Feed/Row1.tsx | 4 ++-- src/components/Feed/Row2.tsx | 4 ++-- src/components/Feed/Row3.tsx | 4 ++-- src/components/Feed/Row5.tsx | 21 ++++++++++++----- src/components/Views/Home.tsx | 41 ++++++++++++++++++++-------------- 6 files changed, 54 insertions(+), 31 deletions(-) diff --git a/src/components/Feed/Beside.tsx b/src/components/Feed/Beside.tsx index e97842fb..a8514e25 100644 --- a/src/components/Feed/Beside.tsx +++ b/src/components/Feed/Beside.tsx @@ -20,6 +20,7 @@ interface BesideProps { topicShortDescription?: boolean topicsBySlug?: { [slug: string]: Topic } iconButton?: boolean + nodate?: boolean } export const Beside = (props: BesideProps) => { @@ -72,7 +73,10 @@ export const Beside = (props: BesideProps) => { /> - + {
- +
diff --git a/src/components/Feed/Row1.tsx b/src/components/Feed/Row1.tsx index c5c07c87..7da01c27 100644 --- a/src/components/Feed/Row1.tsx +++ b/src/components/Feed/Row1.tsx @@ -2,13 +2,13 @@ import { Show } from 'solid-js' import type { Shout } from '../../graphql/types.gen' import { ArticleCard } from './Card' -export const Row1 = (props: { article: Shout }) => ( +export const Row1 = (props: { article: Shout; nodate?: boolean }) => (
- +
diff --git a/src/components/Feed/Row2.tsx b/src/components/Feed/Row2.tsx index 573c4e6c..71fdc1f2 100644 --- a/src/components/Feed/Row2.tsx +++ b/src/components/Feed/Row2.tsx @@ -8,7 +8,7 @@ const x = [ ['8', '4'] ] -export const Row2 = (props: { articles: Shout[]; isEqual?: boolean }) => { +export const Row2 = (props: { articles: Shout[]; isEqual?: boolean; nodate?: boolean }) => { const [y, setY] = createSignal(0) createComputed(() => setY(Math.floor(Math.random() * x.length))) @@ -26,7 +26,7 @@ export const Row2 = (props: { articles: Shout[]; isEqual?: boolean }) => { article={a} settings={{ isWithCover: props.isEqual || x[y()][i()] === '8', - nodate: props.isEqual + nodate: props.isEqual || props.nodate }} />
diff --git a/src/components/Feed/Row3.tsx b/src/components/Feed/Row3.tsx index 7c1e315e..026aca50 100644 --- a/src/components/Feed/Row3.tsx +++ b/src/components/Feed/Row3.tsx @@ -3,7 +3,7 @@ import { For } from 'solid-js' import type { Shout } from '../../graphql/types.gen' import { ArticleCard } from './Card' -export const Row3 = (props: { articles: Shout[]; header?: JSX.Element }) => { +export const Row3 = (props: { articles: Shout[]; header?: JSX.Element; nodate?: boolean }) => { return (
@@ -12,7 +12,7 @@ export const Row3 = (props: { articles: Shout[]; header?: JSX.Element }) => { {(a) => (
- +
)}
diff --git a/src/components/Feed/Row5.tsx b/src/components/Feed/Row5.tsx index 1cc9b3e8..091c2a4b 100644 --- a/src/components/Feed/Row5.tsx +++ b/src/components/Feed/Row5.tsx @@ -1,21 +1,30 @@ import type { Shout } from '../../graphql/types.gen' import { ArticleCard } from './Card' -export const Row5 = (props: { articles: Shout[] }) => { +export const Row5 = (props: { articles: Shout[]; nodate?: boolean }) => { return (
- - + +
- +
- - + +
diff --git a/src/components/Views/Home.tsx b/src/components/Views/Home.tsx index 6abec772..297de3bf 100644 --- a/src/components/Views/Home.tsx +++ b/src/components/Views/Home.tsx @@ -107,7 +107,7 @@ export const HomeView = (props: HomeProps) => { 0}> - + @@ -117,15 +117,17 @@ export const HomeView = (props: HomeProps) => { title={t('Top viewed')} values={topViewedArticles().slice(0, 5)} wrapper={'top-article'} + nodate={true} /> - + @@ -144,13 +146,17 @@ export const HomeView = (props: HomeProps) => { - + - - - {t('Top commented')}} /> + + + {t('Top commented')}} + nodate={true} + /> {randomLayout()} @@ -176,28 +182,29 @@ export const HomeView = (props: HomeProps) => { values={topTopics().slice(0, 5)} wrapper={'topic'} isTopicCompact={true} + nodate={true} /> - - - - + + + + {(page) => ( <> - - - - - - - + + + + + + + )}