Remove author in article cards on the author page

This commit is contained in:
kvakazyambra 2023-10-10 22:45:35 +03:00
parent c6633ae1ec
commit dcd5c591f0
4 changed files with 36 additions and 19 deletions

View File

@ -2,7 +2,12 @@ import { Show } from 'solid-js'
import type { Shout } from '../../graphql/types.gen'
import { ArticleCard } from './ArticleCard'
export const Row1 = (props: { article: Shout; nodate?: boolean; noAuthorLink?: boolean }) => (
export const Row1 = (props: {
article: Shout
nodate?: boolean
noAuthorLink?: boolean
noauthor?: boolean
}) => (
<Show when={!!props.article}>
<div class="floor floor--one-article">
<div class="wide-container">
@ -10,7 +15,12 @@ export const Row1 = (props: { article: Shout; nodate?: boolean; noAuthorLink?: b
<div class="col-24">
<ArticleCard
article={props.article}
settings={{ isSingle: true, nodate: props.nodate, noAuthorLink: props.noAuthorLink }}
settings={{
isSingle: true,
nodate: props.nodate,
noAuthorLink: props.noAuthorLink,
noauthor: props.noauthor
}}
/>
</div>
</div>

View File

@ -13,6 +13,7 @@ export const Row2 = (props: {
isEqual?: boolean
nodate?: boolean
noAuthorLink?: boolean
noauthor?: boolean
}) => {
const [y, setY] = createSignal(0)
@ -33,7 +34,8 @@ export const Row2 = (props: {
settings={{
isWithCover: props.isEqual || x[y()][i()] === '16',
nodate: props.isEqual || props.nodate,
noAuthorLink: props.noAuthorLink
noAuthorLink: props.noAuthorLink,
noauthor: props.noauthor
}}
/>
</div>

View File

@ -8,6 +8,7 @@ export const Row3 = (props: {
header?: JSX.Element
nodate?: boolean
noAuthorLink?: boolean
noauthor?: boolean
}) => {
return (
<Show when={props.articles && props.articles.length > 0}>
@ -20,7 +21,11 @@ export const Row3 = (props: {
<div class="col-md-8">
<ArticleCard
article={a}
settings={{ nodate: props.nodate, noAuthorLink: props.noAuthorLink }}
settings={{
nodate: props.nodate,
noAuthorLink: props.noAuthorLink,
noauthor: props.noauthor
}}
/>
</div>
)}

View File

@ -207,34 +207,34 @@ export const AuthorView = (props: Props) => {
<Match when={page().route === 'author'}>
<Show when={sortedArticles().length === 1}>
<Row1 article={sortedArticles()[0]} noAuthorLink={true} nodate={true} />
<Row1 article={sortedArticles()[0]} noauthor={true} nodate={true} />
</Show>
<Show when={sortedArticles().length === 2}>
<Row2 articles={sortedArticles()} isEqual={true} noAuthorLink={true} nodate={true} />
<Row2 articles={sortedArticles()} isEqual={true} noauthor={true} nodate={true} />
</Show>
<Show when={sortedArticles().length === 3}>
<Row3 articles={sortedArticles()} noAuthorLink={true} nodate={true} />
<Row3 articles={sortedArticles()} noauthor={true} nodate={true} />
</Show>
<Show when={sortedArticles().length > 3}>
<Row1 article={sortedArticles()[0]} noAuthorLink={true} nodate={true} />
<Row2 articles={sortedArticles().slice(1, 3)} isEqual={true} noAuthorLink={true} />
<Row1 article={sortedArticles()[3]} noAuthorLink={true} nodate={true} />
<Row2 articles={sortedArticles().slice(4, 6)} isEqual={true} noAuthorLink={true} />
<Row1 article={sortedArticles()[6]} noAuthorLink={true} nodate={true} />
<Row2 articles={sortedArticles().slice(7, 9)} isEqual={true} noAuthorLink={true} />
<Row1 article={sortedArticles()[0]} noauthor={true} nodate={true} />
<Row2 articles={sortedArticles().slice(1, 3)} isEqual={true} noauthor={true} />
<Row1 article={sortedArticles()[3]} noauthor={true} nodate={true} />
<Row2 articles={sortedArticles().slice(4, 6)} isEqual={true} noauthor={true} />
<Row1 article={sortedArticles()[6]} noauthor={true} nodate={true} />
<Row2 articles={sortedArticles().slice(7, 9)} isEqual={true} noauthor={true} />
<For each={shouts()}>
{(shout) => (
<>
<Row1 article={shout[0]} noAuthorLink={true} nodate={true} />
<Row2 articles={shout.slice(1, 3)} isEqual={true} noAuthorLink={true} />
<Row1 article={shout[3]} noAuthorLink={true} nodate={true} />
<Row2 articles={shout.slice(4, 6)} isEqual={true} noAuthorLink={true} />
<Row1 article={shout[6]} noAuthorLink={true} nodate={true} />
<Row2 articles={shout.slice(7, 9)} isEqual={true} noAuthorLink={true} />
<Row1 article={shout[0]} noauthor={true} nodate={true} />
<Row2 articles={shout.slice(1, 3)} isEqual={true} noauthor={true} />
<Row1 article={shout[3]} noauthor={true} nodate={true} />
<Row2 articles={shout.slice(4, 6)} isEqual={true} noauthor={true} />
<Row1 article={shout[6]} noauthor={true} nodate={true} />
<Row2 articles={shout.slice(7, 9)} isEqual={true} noauthor={true} />
</>
)}
</For>