-
Notifications
You must be signed in to change notification settings - Fork 33
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make comment's actions more visible #165
Conversation
} | ||
{ replies && this.renderAction( |
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.
maybe this renderAction
call could be extract of the JSX code,
there is (too) much (?) logic in 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.
Done
@@ -173,7 +179,7 @@ export class CommentDisplay extends React.PureComponent { | |||
|
|||
actionReply() { | |||
if (!this.ensureAuthenticated()) | |||
return | |||
return null |
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.
not quite fan but this is not core of this PR so nevermind
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.
Actually this is the practice recommended by React : https://reactjs.org/docs/conditional-rendering.html#preventing-component-from-rendering
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.
Returning null
is still better than returning undefined
Before
After