-
Notifications
You must be signed in to change notification settings - Fork 230
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
fix: add a close button to comment input #3897
base: main
Are you sure you want to change the base?
Conversation
@tu2463 is attempting to deploy a commit to the Daily Dev Team on Vercel. A member of the Team first needs to authorize it. |
<CloseButton | ||
size={ButtonSize.XSmall} | ||
className="absolute right-1 top-1 laptop:right-3 laptop:top-3" | ||
onClick={onRequestClose} | ||
/> |
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.
There can be places where this was used, to support backwards compat, and only show this when needed, let's do a conditional.
<CloseButton | |
size={ButtonSize.XSmall} | |
className="absolute right-1 top-1 laptop:right-3 laptop:top-3" | |
onClick={onRequestClose} | |
/> | |
{onRequestClose && ( | |
<CloseButton | |
size={ButtonSize.XSmall} | |
className="absolute right-1 top-1 laptop:right-3 laptop:top-3" | |
onClick={onRequestClose} | |
/> | |
)} |
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.
Great work! Thank you for your effort 🙏
After this, there should be two components we'll need to update to make this work on desktop. The MainComment
and SubComment
components contain a conditional render on the input field we display, we should pass the onRequestClose
value to be a function that clears the state that manages the input itself.
Changes
This PR resolves #1606 dailydotdev/daily#1606
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
-->