Update AuthorBadge mobile view (#302)
This commit is contained in:
parent
081c9c1734
commit
38ab3ddc4b
|
@ -11,6 +11,9 @@
|
|||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
@include media-breakpoint-down(sm) {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(sm) {
|
||||
margin-bottom: 2rem;
|
||||
|
@ -20,12 +23,23 @@
|
|||
text-align: left;
|
||||
}
|
||||
|
||||
.basicInfo {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex: 0 calc(100% - 5.2rem);
|
||||
gap: 1rem;
|
||||
|
||||
@include media-breakpoint-down(sm) {
|
||||
flex: 0 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
@include font-size(1.4rem);
|
||||
|
||||
border: none;
|
||||
display: flex;
|
||||
flex: 0 calc(100% - 5.2rem);
|
||||
flex-direction: column;
|
||||
line-height: 1.3;
|
||||
margin-bottom: 1rem;
|
||||
|
@ -60,6 +74,10 @@
|
|||
margin-left: 5.2rem;
|
||||
gap: 1rem;
|
||||
|
||||
@include media-breakpoint-down(sm) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(sm) {
|
||||
margin-left: 2rem;
|
||||
}
|
||||
|
|
|
@ -78,36 +78,38 @@ export const AuthorBadge = (props: Props) => {
|
|||
|
||||
return (
|
||||
<div class={clsx(styles.AuthorBadge, { [styles.nameOnly]: props.nameOnly })}>
|
||||
<Userpic
|
||||
hasLink={true}
|
||||
size={'M'}
|
||||
name={props.author.name}
|
||||
userpic={props.author.userpic}
|
||||
slug={props.author.slug}
|
||||
/>
|
||||
<a href={`/author/${props.author.slug}`} class={styles.info}>
|
||||
<div class={styles.name}>
|
||||
<span>{props.author.name}</span>
|
||||
</div>
|
||||
<Show when={!props.nameOnly}>
|
||||
<Switch
|
||||
fallback={
|
||||
<div class={styles.bio}>
|
||||
{t('Registered since {date}', { date: formatDate(new Date(props.author.createdAt)) })}
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<Match when={props.author.bio}>
|
||||
<div class={clsx('text-truncate', styles.bio)} innerHTML={props.author.bio} />
|
||||
</Match>
|
||||
<Match when={props.author?.stat && props.author?.stat.shouts > 0}>
|
||||
<div class={styles.bio}>
|
||||
{t('PublicationsWithCount', { count: props.author.stat?.shouts ?? 0 })}
|
||||
</div>
|
||||
</Match>
|
||||
</Switch>
|
||||
</Show>
|
||||
</a>
|
||||
<div class={styles.basicInfo}>
|
||||
<Userpic
|
||||
hasLink={true}
|
||||
size={'M'}
|
||||
name={props.author.name}
|
||||
userpic={props.author.userpic}
|
||||
slug={props.author.slug}
|
||||
/>
|
||||
<a href={`/author/${props.author.slug}`} class={styles.info}>
|
||||
<div class={styles.name}>
|
||||
<span>{props.author.name}</span>
|
||||
</div>
|
||||
<Show when={!props.nameOnly}>
|
||||
<Switch
|
||||
fallback={
|
||||
<div class={styles.bio}>
|
||||
{t('Registered since {date}', { date: formatDate(new Date(props.author.createdAt)) })}
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<Match when={props.author.bio}>
|
||||
<div class={clsx('text-truncate', styles.bio)} innerHTML={props.author.bio} />
|
||||
</Match>
|
||||
<Match when={props.author?.stat && props.author?.stat.shouts > 0}>
|
||||
<div class={styles.bio}>
|
||||
{t('PublicationsWithCount', { count: props.author.stat?.shouts ?? 0 })}
|
||||
</div>
|
||||
</Match>
|
||||
</Switch>
|
||||
</Show>
|
||||
</a>
|
||||
</div>
|
||||
<Show when={props.author.slug !== session()?.user.slug && !props.nameOnly}>
|
||||
<div class={styles.actions}>
|
||||
<Show
|
||||
|
|
Loading…
Reference in New Issue
Block a user