-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
refactor CreateMenu to have dynamic items #1548
refactor CreateMenu to have dynamic items #1548
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
style={styles.chatItemAttachButton} | ||
underlayColor={themeColors.componentBG} | ||
> | ||
<Icon src={Paperclip} /> |
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.
left this icon as a Paperclip
, might want to update to make it seem more like a menu icon
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.
Ah good point, I forgot to mention but we have a new icon for 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.
Thanks for the PR! Code looks mostly good, just a couple of comments
Also, could you update your PR to fix the merge conflict and the description to update the fixed issued link, and I think you mean
Enter a convo with just one person? |
…te-menu # Conflicts: # src/pages/home/sidebar/SidebarScreen.js
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.
Looking good 👍
Apart from a few minor comments, I think the main change necessary is an improvement to the hack that @thienlnam pointed out.
Tried to test the PR but it doesn't seem like the Add Attachment button is working for me at all even with the timeout |
hmm looks the change to conditionally render the component with |
@Julesssss looks like conditionally rendering using
let me know if this is fine, otherwise I can revert the conditional rendering. I haven't been able to get the modals to work without using setTimeout, what's strange is |
@Maftalion ah, lets revert to the previous solution then. I'm also not sure why the callback doesn't work without setTimeout, it might be worth sharing the issue in the Contributor chat slack channel to see if anyone else has an idea. |
Hmm, the I tried looking for a specific callback that was closing the AttachmentPicker with no luck — the ReportActionCompose Component props aren’t changing (I thought this might be the issue) I noticed that only iOS has the Attachment closing issue btw. Android, Web & Desktop all work fine, so it might be worth looking for similar iOS bugs/solutions. I’m a bit confused by the reverse nesting of within and wonder if this is necessary/could be made simpler? This isn't in scope for this PR though |
Regarding the plus asset, I noticed we already have it so I can just swap it in. Do you also want the border gone like your screenshot above or is this fine? |
@Maftalion your screenshot looks perfect, let's go with that. |
Hey @Maftalion. just wanted to check in and provide some guidance for moving forward. As we'll need to resolve the issue without the We would then aim to resolve the issue within the offending library and if this was of interest to you we would treat this as a separate issue and provide an additional payment. Once the library issue is fixed, this PR can be taken off hold and merged. |
# Conflicts: # src/components/Icon/Expensicons.js
Hey @Julesssss, I've been unable to get it to work without the setTimeout. I've tried looking for re-render issues, moving things around and calling the Api directly instead of I then looked into the Which meant the issue was probably with the modal library |
Hey @Maftalion, apologies for the delayed response. Thanks for looking into the modal library and potential solutions. Lets leave this PR on hold while I try to get the |
Hi @Maftalion. I'm sorry for keeping you waiting for so long! To move forward, we'll merge this PR with the Would you mind fixing the conflicts with master to finish up here? I'll make sure to add a bonus to the payout as this is due to my delay. |
# Conflicts: # src/CONST.js # src/components/CreateMenu.js # src/components/Icon/Expensicons.js # src/pages/home/ReportScreen.js # src/pages/home/report/ReportActionCompose.js # src/pages/home/report/ReportView.js # src/pages/home/sidebar/SidebarScreen.js
@Julesssss no worries! fixed the merge conflicts |
Okay, we're almost there. I'm going to branch from here to prepare a PR locking the feature behind the new internal IOU Beta flag, once this is completed I will merge this issue and quickly follow it up by merging the beta flag PR. Should be first thing Monday. |
Hello! @Julesssss @Maftalion |
Hi @isagoico. Yeah, good point. Let's skip testing for this one in that case. I'll add the test steps to the PR which re-enables the new options. |
Details
CreateMenu
to take a dynamic list of items based onMENU_ITEM_KEYS
enumReportActionCompose
to open the original attachment modal whenAttachmentPicker
is selectedFixed Issues
Fixes https://github.com//issues/1508Tests
SplitBill|AddAttachment
options when clicking the attach iconRequestMoney |AddAttachment
options when clicking the attach iconTested On
Video Walkthrough
Screen.Recording.2021-02-22.at.10.33.44.PM.mov
Screenshots
Web
Mobile Web
Desktop
iOS
Android