Followers list on authors page.

Replaced "compact" props with "hideWriteButton" in the author card component.
This commit is contained in:
kvakazyambra 2023-03-24 00:39:13 +03:00
parent 1c1cfe9b40
commit 9b22627908
7 changed files with 22 additions and 15 deletions

View File

@ -101,7 +101,6 @@ export const Comment = (props: Props) => {
<Userpic
user={comment().createdBy as Author}
isBig={false}
isAuthorsList={false}
class={clsx({
[styles.compactUserpic]: props.compact
})}

View File

@ -135,10 +135,12 @@ export const FullArticle = (props: ArticleProps) => {
)}
</For>
</div>
<div
class={styles.shoutCover}
style={{ 'background-image': `url('${props.article.cover}')` }}
/>
<Show when={props.article.cover}>
<div
class={styles.shoutCover}
style={{ 'background-image': `url('${props.article.cover}')` }}
/>
</Show>
</div>
<Show when={media() && props.article.layout !== 'image'}>
@ -254,7 +256,7 @@ export const FullArticle = (props: ArticleProps) => {
<For each={props.article.authors}>
{(a) => (
<div class="col-xl-6">
<AuthorCard author={a} compact={false} hasLink={true} liteButtons={true} />
<AuthorCard author={a} hasLink={true} liteButtons={true} />
</div>
)}
</For>

View File

@ -16,7 +16,7 @@ import { useLocalize } from '../../context/localize'
interface AuthorCardProps {
caption?: string
compact?: boolean
hideWriteButton?: boolean
hideDescription?: boolean
hideFollow?: boolean
hasLink?: boolean
@ -166,7 +166,7 @@ export const AuthorCard = (props: AuthorCardProps) => {
</button>
</Show>
<Show when={!props.compact && !props.isAuthorsList}>
<Show when={!props.hideWriteButton}>
<button
class={styles.button}
classList={{

View File

@ -6,7 +6,7 @@ export const AuthorFull = (props: { author: Author }) => {
return (
<div class="row">
<div class="col-md-9 col-lg-8 user-details">
<AuthorCard author={props.author} compact={false} isAuthorPage={true} />
<AuthorCard author={props.author} isAuthorPage={true} />
</div>
</div>
)

View File

@ -69,7 +69,7 @@ export const Beside = (props: BesideProps) => {
<Show when={props.wrapper === 'author'}>
<AuthorCard
author={value as Author}
compact={true}
hideWriteButton={true}
hasLink={true}
truncateBio={true}
/>

View File

@ -207,9 +207,15 @@ export const AuthorView = (props: AuthorProps) => {
</Match>
<Match when={searchParams().by === 'followed'}>
<div class="wide-container">
<ul class={stylesArticle.comments}>
<For each={followers()}>{(follower: Author) => <AuthorCard author={follower} />}</For>
</ul>
<div class="row">
<For each={followers()}>
{(follower: Author) => (
<div class="col-md-6 col-lg-4">
<AuthorCard author={follower} hideWriteButton={true} hasLink={true} />
</div>
)}
</For>
</div>
</div>
</Match>
<Match when={searchParams().by === 'rating'}>

View File

@ -124,7 +124,7 @@ export const FeedView = () => {
<For each={topAuthors().slice(0, 5)}>
{(author) => (
<li>
<AuthorCard author={author} compact={true} hasLink={true} />
<AuthorCard author={author} hideWriteButton={true} hasLink={true} />
</li>
)}
</For>
@ -147,7 +147,7 @@ export const FeedView = () => {
<AuthorCard
author={comment.createdBy as Author}
isFeedMode={true}
compact={true}
hideWriteButton={true}
hideFollow={true}
/>
<div class={clsx('text-truncate', styles.commentArticleTitle)}>