diff --git a/pkg/interface/src/views/apps/links/LinkResource.tsx b/pkg/interface/src/views/apps/links/LinkResource.tsx index 0bf62c8452..d5b3c0fad2 100644 --- a/pkg/interface/src/views/apps/links/LinkResource.tsx +++ b/pkg/interface/src/views/apps/links/LinkResource.tsx @@ -107,7 +107,7 @@ export function LinkResource(props: LinkResourceProps) { return ( - {"<- Back"} + {"<- Back"} diff --git a/pkg/interface/src/views/components/Comments.tsx b/pkg/interface/src/views/components/Comments.tsx index 56c08fe17c..966d43d54c 100644 --- a/pkg/interface/src/views/components/Comments.tsx +++ b/pkg/interface/src/views/components/Comments.tsx @@ -11,6 +11,7 @@ import { createPost, createBlankNodeWithChildPost } from '~/logic/api/graph'; import { getLatestCommentRevision } from '~/logic/lib/publish'; import tokenizeMessage from '~/logic/lib/tokenizeMessage'; import { getUnreadCount } from '~/logic/lib/hark'; +import {PropFunc} from '~/types/util'; interface CommentsProps { comments: GraphNode; @@ -24,8 +25,19 @@ interface CommentsProps { group: Group; } -export function Comments(props: CommentsProps) { - const { association, comments, ship, name, api, history, baseUrl, group } = props; +export function Comments(props: CommentsProps & PropFunc) { + const { + association, + comments, + ship, + name, + editCommentId, + api, + history, + baseUrl, + group, + ...rest + } = props; const onSubmit = async ( { comment }, @@ -52,7 +64,7 @@ export function Comments(props: CommentsProps) { actions: FormikHelpers<{ comment: string }> ) => { try { - const commentNode = comments.children.get(bigInt(props.editCommentId))!; + const commentNode = comments.children.get(bigInt(editCommentId))!; const [idx, _] = getLatestCommentRevision(commentNode); const content = tokenizeMessage(comment); @@ -70,8 +82,8 @@ export function Comments(props: CommentsProps) { }; let commentContent = null; - if (props.editCommentId) { - const commentNode = comments.children.get(bigInt(props.editCommentId)); + if (editCommentId) { + const commentNode = comments.children.get(bigInt(editCommentId)); const [_, post] = getLatestCommentRevision(commentNode); commentContent = post.contents.reduce((val, curr) => { if ('text' in curr) { @@ -102,9 +114,9 @@ export function Comments(props: CommentsProps) { const readCount = children.length - getUnreadCount(props?.unreads, association['app-path'], parentIndex) return ( - - {( !props.editCommentId ? : null )} - {( !!props.editCommentId ? ( + + {( !editCommentId ? : null )} + {( !!editCommentId ? ( = readCount} baseUrl={props.baseUrl} group={group} - pending={idx.toString() === props.editCommentId} + pending={idx.toString() === editCommentId} /> ); })}