Merge remote-tracking branch 'origin/dev' into comments_reactions

# Conflicts:
#	public/locales/en/translation.json
#	public/locales/ru/translation.json
This commit is contained in:
ilya-bkv 2023-03-09 20:06:06 +03:00
commit 401eecdc18
5 changed files with 28 additions and 13 deletions

View File

@ -231,6 +231,5 @@
"Your name will appear on your profile page and as your signature in publications, comments and responses.": "Your name will appear on your profile page and as your signature in publications, comments and responses",
"zine": "zine",
"By time": "By time",
"New only": "New only",
"You can't vote twice": "You cannot vote twice"
"New only": "New only"
}

View File

@ -248,5 +248,8 @@
"user already exist": "пользователь уже существует",
"view": "просмотр",
"zine": "журнал",
"By time": "По порядку"
"By time": "По порядку",
"New only": "Только новые",
"Bookmarks": "Закладки",
"Logout": "Выход"
}

View File

@ -105,6 +105,14 @@ export const FullArticle = (props: ArticleProps) => {
actions: { loadReactionsBy }
} = useReactions()
let commentsRef: HTMLDivElement | undefined
const scrollToComments = () => {
if (!isReactionsLoaded()) {
return
}
commentsRef.scrollIntoView({ behavior: 'smooth' })
}
return (
<>
<Title>{props.article.title}</Title>
@ -195,9 +203,9 @@ export const FullArticle = (props: ArticleProps) => {
</div>
</Show>
<div class={styles.shoutStatsItem}>
<div class={styles.shoutStatsItem} onClick={() => scrollToComments()}>
<Icon name="comment" class={styles.icon} />
{props.article.stat?.commented || ''}
{/*{props.article.stat?.commented || ''}*/}
</div>
<div class={styles.shoutStatsItem}>
@ -259,6 +267,7 @@ export const FullArticle = (props: ArticleProps) => {
)}
</For>
</div>
<div ref={commentsRef}>
<Show when={isReactionsLoaded()}>
<CommentsTree
shoutId={props.article.id}
@ -268,6 +277,7 @@ export const FullArticle = (props: ArticleProps) => {
</Show>
</div>
</div>
</div>
</>
)
}

View File

@ -39,6 +39,7 @@ export default gql`
viewed
reacted
rating
commented
}
}
}

View File

@ -139,7 +139,9 @@ export const ProfileSettingsPage = () => {
value={form.slug}
class="nolabel"
/>
<Show when={slugError()}>
<p class="form-message form-message--error">{t(`${slugError()}`)}</p>
</Show>
</div>
</div>
</div>