Fixed author link style in dark blocks

This commit is contained in:
kvakazyambra 2023-11-21 00:31:52 +03:00
parent af5379ebf5
commit 11cd9641e0
3 changed files with 26 additions and 2 deletions

View File

@ -49,3 +49,16 @@
}
}
}
.authorLinkFloorImportant {
.link {
&:hover {
background: #fff !important;
.name {
background: none;
color: #000;
}
}
}
}

View File

@ -9,11 +9,16 @@ type Props = {
author: Author
size?: 'XS' | 'M' | 'L'
class?: string
isFloorImportant?: boolean
}
export const AuthorLink = (props: Props) => {
return (
<div class={clsx(styles.AuthorLink, props.class, styles[props.size ?? 'M'])}>
<div
class={clsx(styles.AuthorLink, props.class, styles[props.size ?? 'M'], {
[styles.authorLinkFloorImportant]: props.isFloorImportant,
})}
>
<a class={styles.link} href={`/author/${props.author.slug}`}>
<Userpic size={props.size ?? 'M'} name={props.author.name} userpic={props.author.userpic} />
<div class={styles.name}>{props.author.name}</div>

View File

@ -210,7 +210,13 @@ export const ArticleCard = (props: ArticleCardProps) => {
<div class={styles.shoutAuthor}>
<For each={props.article.authors}>
{(author) => {
return <AuthorLink size={'XS'} author={author} />
return (
<AuthorLink
size={'XS'}
author={author}
isFloorImportant={props.settings.isFloorImportant || props.settings?.isWithCover}
/>
)
}}
</For>
</div>