Merge branch 'prepare-comments' into prepare-inbox

This commit is contained in:
tonyrewin 2022-11-23 08:33:30 +03:00
commit 75af4d5ce0
3 changed files with 17 additions and 23 deletions

View File

@ -22,7 +22,7 @@ export const ArticleView = (props: ArticlePageProps) => {
try { try {
setIsCommentsLoading(true) setIsCommentsLoading(true)
await loadReactionsBy({ await loadReactionsBy({
by: { shout: props.article.slug }, by: { shout: props.article.slug, comment: true },
limit: ARTICLE_COMMENTS_PAGE_SIZE, limit: ARTICLE_COMMENTS_PAGE_SIZE,
offset: getCommentsPage() * ARTICLE_COMMENTS_PAGE_SIZE offset: getCommentsPage() * ARTICLE_COMMENTS_PAGE_SIZE
}) })

View File

@ -12,10 +12,18 @@ interface StatMetricsProps {
} }
const pseudonames = { const pseudonames = {
comments: 'discussions' // topics: 'topics' # amount of topics for community💥
followed: 'followers',
followers: 'followers',
reacted: 'involvings',
reactions: 'involvings',
commented: 'discoussions',
comments: 'discussions',
shouts: 'posts',
authors: 'authors'
} }
const nos = (s) => s.slice(0, s.length - 1) const nos = (s) => s.slice(0, -1)
export const StatMetrics = (props: StatMetricsProps) => { export const StatMetrics = (props: StatMetricsProps) => {
return ( return (

View File

@ -1,32 +1,18 @@
import { gql } from '@urql/core' import { gql } from '@urql/core'
export default gql` export default gql`
query LoadReactionsByQuery($by: ReactionBy!, $limit: Int!, $offset: Int!) { query LoadReactions($by: ReactionBy!, $limit: Int, $offset: Int) {
loadReactionsBy(by: $by, limit: $limit, offset: $offset) { loadReactionsBy(by: $by, limit: $limit, offset: $offset) {
id id
createdBy {
slug
name
userpic
}
body
kind
createdAt
updatedAt
shout { shout {
slug
title title
} }
replyTo { body
id createdAt
createdBy { createdBy {
slug name
userpic
name
}
body
kind
} }
updatedAt
} }
} }
` `