Skip to content

Commit

Permalink
Merge pull request #4832 from thematters/fix/comment-input-visitor-mode
Browse files Browse the repository at this point in the history
fix(ArticleCommentForm): fix visitor mode in form
  • Loading branch information
wlliaml authored Sep 3, 2024
2 parents dd48562 + 41fd4fb commit c0cd092
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/Forms/ArticleCommentForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ export const ArticleCommentForm: React.FC<ArticleCommentFormProps> = ({
id: 'bTNYGv',
description: 'src/components/Forms/ArticleCommentForm/index.tsx',
})}
onClick={(event) => {
if (!viewer.isAuthed) {
event.preventDefault()
window.dispatchEvent(
new CustomEvent(OPEN_UNIVERSAL_AUTH_DIALOG, {
detail: { trigger: UNIVERSAL_AUTH_TRIGGER.collectArticle },
})
)
return
}
}}
>
<section className={styles.content}>
<CommentEditor
Expand Down

0 comments on commit c0cd092

Please sign in to comment.