-
Notifications
You must be signed in to change notification settings - Fork 2
feat: make table values copy-able #251
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
Conversation
neomorphic
left a comment
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.
The code works and the UI looks good to me. I left a couple of comments about the useContextMenu.
|
|
||
| // Context menu state | ||
| const { | ||
| contextMenuCoords, |
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.
Why are you importing the contextMenuCoords here, only to pass them on to the ContextMenu component. Couldn't you have the const {contextMenuCoords} = useContextMenu<CellContextMenuData>(); call in the ContextMenu component? What am I missing?
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.
I've found when working with hooks if there is state that is operated on by functions also exposed by the hook, the behavior gets weird if you don't create the state and function together in one component and pass them down together, if needed. So specifically for the showContextMenu state, if I create fresh state in the ContextMenu by calling the hook again, the close function is not operating on the showContextMenu state in TableCard, so the context menu stays visible.
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.
| contextData, | ||
| menuRef, | ||
| openContextMenu, | ||
| closeContextMenu |
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.
Same question here. Why is this being imported here and not in the ContextMenu component?
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.
See above response
Clickup id: 86aceaxy3
This PR makes the values in the data links and task tables copy-able in two ways:
In the process of making this change, I refactored the copy tooltip logic to a hook and made a
CopyTooltipreusable component (I had originally thought I would go the "click to copy" route, and use the tooltip to indicate the text had been copied). I also refactored the context menu from theFileBrowserto make it reusable for the tables.@krokicki