Merge branch 'prepare-comments' into prepare-inbox
This commit is contained in:
commit
6c6b0ccfd2
|
@ -12,7 +12,7 @@ interface ArticlePageProps {
|
||||||
const ARTICLE_COMMENTS_PAGE_SIZE = 50
|
const ARTICLE_COMMENTS_PAGE_SIZE = 50
|
||||||
|
|
||||||
export const ArticleView = (props: ArticlePageProps) => {
|
export const ArticleView = (props: ArticlePageProps) => {
|
||||||
const [getCommentsPage] = createSignal(1)
|
const [getCommentsPage] = createSignal(0)
|
||||||
const [getIsCommentsLoading, setIsCommentsLoading] = createSignal(false)
|
const [getIsCommentsLoading, setIsCommentsLoading] = createSignal(false)
|
||||||
const { reactionsByShout, loadReactionsBy } = useReactionsStore({ reactions: props.reactions })
|
const { reactionsByShout, loadReactionsBy } = useReactionsStore({ reactions: props.reactions })
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ export const StatMetrics = (props: StatMetricsProps) => {
|
||||||
<span class={styles.statMetricsItem} classList={{ compact: props.compact }}>
|
<span class={styles.statMetricsItem} classList={{ compact: props.compact }}>
|
||||||
{props.stat[entity] +
|
{props.stat[entity] +
|
||||||
' ' +
|
' ' +
|
||||||
t(nos(pseudonames[entity] || entity)) +
|
t((pseudonames[entity] || entity).slice(-1)) +
|
||||||
plural(props.stat[entity] || 0, locale() === 'ru' ? ['ов', '', 'а'] : ['s', '', 's'])}
|
plural(props.stat[entity] || 0, locale() === 'ru' ? ['ов', '', 'а'] : ['s', '', 's'])}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -4,14 +4,18 @@ export default gql`
|
||||||
query LoadReactions($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
|
||||||
shout {
|
|
||||||
title
|
|
||||||
}
|
|
||||||
body
|
body
|
||||||
createdAt
|
range
|
||||||
|
replyTo {
|
||||||
|
id
|
||||||
|
# kind
|
||||||
|
}
|
||||||
createdBy {
|
createdBy {
|
||||||
name
|
name
|
||||||
|
slug
|
||||||
|
userpic
|
||||||
}
|
}
|
||||||
|
createdAt
|
||||||
updatedAt
|
updatedAt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ export const byLength = (
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export const byStat = (metric: keyof Stat) => {
|
export const byStat = (metric: keyof Stat | keyof TopicStat) => {
|
||||||
return (a, b) => {
|
return (a, b) => {
|
||||||
const x = (a?.stat && a.stat[metric]) || 0
|
const x = (a?.stat && a.stat[metric]) || 0
|
||||||
const y = (b?.stat && b.stat[metric]) || 0
|
const y = (b?.stat && b.stat[metric]) || 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user