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