Fixed comments control in the article footer

This commit is contained in:
kvakazyambra 2023-11-10 01:33:21 +03:00
parent bf0d96be19
commit 13fb802365
2 changed files with 16 additions and 6 deletions

View File

@ -354,9 +354,12 @@ export const FullArticle = (props: Props) => {
<div class={clsx(styles.shoutStatsItem)} ref={triggerRef} onClick={scrollToComments}>
<Icon name="comment" class={styles.icon} />
<Icon name="comment-hover" class={clsx(styles.icon, styles.iconHover)} />
<span class={styles.commentsTextLabel}>
{props.article.stat?.commented || t('Add' + ' comment')}
</span>
<Show
when={props.article.stat?.commented}
fallback={<span class={styles.commentsTextLabel}>{t('Add comment')}</span>}
>
{props.article.stat?.commented}
</Show>
</div>
)}
</Popover>

View File

@ -230,9 +230,16 @@ export const ArticleCard = (props: ArticleCardProps) => {
name="comment-hover"
class={clsx(styles.icon, styles.iconHover, styles.feedControlIcon)}
/>
<Show
when={props.article.stat?.commented}
fallback={
<span class={clsx(styles.shoutCardLinkContainer, styles.shoutCardDetailsItemLabel)}>
{props.article.stat?.commented || t('Add comment')}
{t('Add comment')}
</span>
}
>
{props.article.stat?.commented}
</Show>
</a>
</div>