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
Type and rewrite components as function-components #3795
Conversation
3f5c1ae
to
d558e09
Compare
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.
Very sexy PR - I love to review this kind of stuff 馃挴
export type EmojiWithReactionData = Emoji & { | ||
hasReacted: boolean; | ||
reactionId: ID; | ||
}; |
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.
Perhaps move this to a dedicated models file, since it is used other places?
c0b501c
to
0e27d20
Compare
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.
Awesome work 馃挴 馃
e.target instanceof Node && | ||
nodeRef.current.contains(e.target) |
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.
Could you elaborate on this?
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.
nodeRef
is a ref to the current emoji-picker div-element
e.target
is the thing that was clicked
If we click inside the emoji-picker, nodeRef.current.contains(e.target) === true
, and we don't want to close it. All other clicks should close it.
0e27d20
to
2fea5f2
Compare
2fea5f2
to
23d898e
Compare
Description
Comment
-component to a function component and typed it's props plus some props in other related components.Quote
andQuoteList
components.Reaction
- andReactions
-components as functions, and typed a bunch of reaction related stuffreaction
entity-reducer from redux, and improved state type formutateReactions
mutator.MeetingAnswer
a function-component. Spent some time looking at theMeetingAnswer
-component that had a few bugs.For reviewing I highly recommend selecting "No whitespace" as refactoring like this often changes the indentation level, leading to huge amounts of whitespace changes.
Result
We are now under 1000 ESLint warnings! 馃コ
And here is the
MeetingAnswer
-screen, which now works (it only shows up when not logged in)Before:
After: (it now shows if you accepted or declined, and the login-button works)
Poem
馃 Generated by Copilot at 3f5c1ae
Testing
I've been clicking around the pages, making sure I didn't make any functional changes.
Resolves webkom/lego#2891