stacker.news/fragments/comments.js
ekzyis d1ed72bb85
Allow territory founders to pin items (#767)
* Add pinning of items

* Fix empty section in context menu

* Pin comments

* Fix layout shift during comment pinning

* Add comments, rename, formatting

* Max 3 pins allowed

* Fix argument

* Fix missing position update for other items

* Improve error message

* only show saloon in home

* refine pinItem style and transaction usage

* pin styling enhancements

* simpler handling of excess pins

* fix pin positioning like mergePins

* give existing pins null subName

* prevent empty items on load

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-01-30 11:04:56 -06:00

92 lines
1.4 KiB
JavaScript

import { gql } from '@apollo/client'
export const COMMENT_FIELDS = gql`
fragment CommentFields on Item {
id
position
parentId
createdAt
deletedAt
text
user {
id
name
optional {
streak
}
meMute
}
sats
meAnonSats @client
upvotes
freedFreebie
boost
meSats
meDontLikeSats
meBookmark
meSubscription
outlawed
freebie
path
commentSats
mine
otsHash
ncomments
imgproxyUrls
}
`
export const COMMENTS_ITEM_EXT_FIELDS = gql`
fragment CommentItemExtFields on Item {
text
root {
id
title
bounty
bountyPaidTo
subName
sub {
name
userId
moderated
meMuteSub
}
user {
name
optional {
streak
}
id
}
}
}`
// we only get the first COMMENT_DEPTH_LIMIT comments
export const COMMENTS = gql`
${COMMENT_FIELDS}
fragment CommentsRecursive on Item {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
comments {
...CommentFields
}
}
}
}
}
}
}
}`