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

View File

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

View File

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

View File

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