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", "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", "zine": "zine",
"By time": "By time", "By time": "By time",
"New only": "New only", "New only": "New only"
"You can't vote twice": "You cannot vote twice"
} }

View File

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

View File

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

View File

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

View File

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