Skip to content

Commit

Permalink
fix: pin comment after achivements criteria and deps, #1434
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Aug 8, 2023
1 parent f876d7e commit 72779fb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 36 deletions.
37 changes: 19 additions & 18 deletions src/components/GoalPage/GoalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,24 +353,6 @@ export const GoalPage = ({ user, ssrTime, params: { id } }: ExternalPageProps<{
feed={_activityFeed}
header={
<>
{nullable(lastStateComment, (value) => (
<CommentView
pin
id={value.id}
author={value.activity?.user}
description={value.description}
state={value.state}
createdAt={value.createdAt}
reactions={value.reactions}
onSubmit={
value.activity?.id === user?.activityId
? onCommentUpdate(value.id)
: undefined
}
onReactionToggle={onCommentReactionToggle(value.id)}
onDelete={onCommentDelete(value.id)}
/>
))}
{nullable(goalAchiveCriteria.length || _isEditable, () => (
<GoalCriteria
goalId={id}
Expand Down Expand Up @@ -408,6 +390,25 @@ export const GoalPage = ({ user, ssrTime, params: { id } }: ExternalPageProps<{
</GoalDependencyListByKind>
)),
)}

{nullable(lastStateComment, (value) => (
<CommentView
pin
id={value.id}
author={value.activity?.user}
description={value.description}
state={value.state}
createdAt={value.createdAt}
reactions={value.reactions}
onSubmit={
value.activity?.id === user?.activityId
? onCommentUpdate(value.id)
: undefined
}
onReactionToggle={onCommentReactionToggle(value.id)}
onDelete={onCommentDelete(value.id)}
/>
))}
</>
}
footer={
Expand Down
37 changes: 19 additions & 18 deletions src/components/GoalPreview/GoalPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,24 +315,6 @@ export const GoalPreviewModal: React.FC<GoalPreviewProps> = ({ shortId, goal, de
feed={_activityFeed}
header={
<>
{nullable(lastStateComment, (value) => (
<CommentView
pin
id={value.id}
author={value.activity?.user}
description={value.description}
state={value.state}
createdAt={value.createdAt}
reactions={value.reactions}
onSubmit={
value.activity?.id === user?.activityId
? onCommentUpdate(value.id)
: undefined
}
onReactionToggle={onCommentReactionToggle(value.id)}
onDelete={onCommentDelete(value.id)}
/>
))}
{nullable(goalAchiveCriteria.length || _isEditable, () => (
<GoalCriteria
goalId={id}
Expand Down Expand Up @@ -367,6 +349,25 @@ export const GoalPreviewModal: React.FC<GoalPreviewProps> = ({ shortId, goal, de
</GoalDependencyListByKind>
)),
)}

{nullable(lastStateComment, (value) => (
<CommentView
pin
id={value.id}
author={value.activity?.user}
description={value.description}
state={value.state}
createdAt={value.createdAt}
reactions={value.reactions}
onSubmit={
value.activity?.id === user?.activityId
? onCommentUpdate(value.id)
: undefined
}
onReactionToggle={onCommentReactionToggle(value.id)}
onDelete={onCommentDelete(value.id)}
/>
))}
</>
}
footer={
Expand Down

0 comments on commit 72779fb

Please sign in to comment.