-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
add pin comment #932
base: dev
Are you sure you want to change the base?
add pin comment #932
Conversation
Someone is attempting to deploy a commit to the RSS3 Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. I have some suggestions here.
if (aIsPinned !== bIsPinned) { | ||
return bIsPinned - aIsPinned | ||
} | ||
const aDate = new Date(a.updatedAt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use createdAt
const { t } = useTranslation("common") | ||
|
||
const data = comments.data?.pages.filter( | ||
(page) => (page?.list?.length ?? 0) > 0, | ||
) | ||
const sortedData = data?.map((item) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic should be placed within pageModel.getComments
, and the pinned comment should be requested separately to ensure that it is always returned. You can refer to pinnedNote
in getPagesBySite
.
@@ -829,6 +831,7 @@ export async function updateComment( | |||
content, | |||
tags: ["comment"], | |||
sources: ["xlog"], | |||
pinned, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot use pinned
here because it does not comply with the Note Metadata specs. Instead, you can place it in the attributes
field.
Thank you, I will make some modifications |
WHAT
馃 Generated by Copilot at 369327d
Added the ability to pin and unpin comments on pages. This feature allows users to highlight important or relevant comments and sort them by priority. Modified the
Comment
,CommentItem
, andpage
components and models, and added Chinese translations for the pin-related UI.馃 Generated by Copilot at 369327d
WHY
I want to pin some comments
HOW
馃 Generated by Copilot at 369327d
useUpdateComment
hook to enable pinning comments (link, link, link, link, link)VirtualList
(link, link)pinned
state and prop toCommentItem
component and conditionally render pin button (link, link)pinned
parameter toupdateComment
function in page model and update comment metadata on blockchain (link, link)CLAIM REWARDS
xlog: https://raye.xlog.app/
discord: rayepeng
For first-time contributors, please leave your xLog address and Discord ID below to claim your rewards.