Skip to content
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

[IOU] Make CreateMenu dynamic, add launch Modal options #1508

Closed
jboniface opened this issue Feb 18, 2021 · 3 comments
Closed

[IOU] Make CreateMenu dynamic, add launch Modal options #1508

jboniface opened this issue Feb 18, 2021 · 3 comments
Assignees

Comments

@jboniface
Copy link

jboniface commented Feb 18, 2021

If you haven’t already, check out our contributing guidelines for onboarding!


view the job on Upwork here.

Platform - version:
current

Deliverables:

This issue builds on top of the existing CreateMenu Bottom Drawer (original issue which introduced this modal can be found here)
New Menu Chat (2)

Chat (3)

  1. Add a menuOption enum to the CreateMenu class
    • With the following types: NewChat: 'NewChat', NewGroup: 'NewGroup', RequestMoney: 'RequestMoney', SplitBill: 'SplitBill', AttachmentPicker: 'AttachmentPicker'
  2. Add a new CreateMenu prop menuOptions which takes an array of the above menuOptions. The menuItemData array should be modified and should now be created dynamically in the constructor, based upon the menuOptions prop
  3. The existing usage of the CreateMenu Modal should then be refactored to use the new prop method (for example here), and new array items should be generated for the new menuOptions (RequestMoney, SplitBill, AttachmentPicker). For now RequestMoney & SplitBill can redirect to an existing route.
  4. A new prop should be created on The ReportView Component: hasMultipleParticipants which will be true if participants is greater than 2
  5. In a 1:1 or group chat, the attachment picker should be replaced with the CreateMenu Component.
    • The ReportView hasMultipleParticipants prop should then be used to determine the correct menu options to pass in (SplitBill|AddAttachment if true, else RequestMoney|AddAttachment).
    • When the AttachmentPicker option is selected, a callback to the parent component should be invoked via another new prop: onAttachmentPickerSelected or something similar. Finally, this callback should trigger the AttachmentPicker to be rendered from the ReportActionCompose Component, like it was prior to the CreateMenu addition.
  6. The new image assets (for the new menu items) should be added as Expensicons here -- these should be available as the attachment: MenuIcons.zip
@Maftalion
Copy link
Contributor

Hello,
I'd like to take on this task.

Proposal

  1. refactor the CreateMenu class to accept the menuOptions listed above as a prop.
  2. move the menuItemData out of the render and build the array instead in the constructor based on the menuOptions props.
  3. update existing uses of the CreateMenu component to pass the menu items.
  4. update CreateMenu to have a new hasMultipleParticipants prop when more than one participant and if true the menu items would be SplitBill|AddAttachment or RequestMoney|AddAttachment if not true.
  5. add onAttachmentPickerSelected which will render AttachmentPicker if that option is selected

@Jag96
Copy link
Contributor

Jag96 commented Feb 22, 2021

@Maftalion your proposal looks good 👍

@trjExpensify trjExpensify changed the title Make CreateMenu dynamic, add launch Modal options [IOU] Make CreateMenu dynamic, add launch Modal options Feb 22, 2021
@Jag96
Copy link
Contributor

Jag96 commented Mar 25, 2021

Looks like this was fixed by #1548, closing

@Jag96 Jag96 closed this as completed Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants