-
-
Notifications
You must be signed in to change notification settings - Fork 35
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 resource modal - v2 #463
Refactor resource modal - v2 #463
Conversation
The mobile resource menu modal shown state was being handled with its own action, TOGGLE_RESOURCE_MENU. Here we retire that action, and instead use SET_TOOLBAR_MODAL, which is consistent with how other toolbar modals' shown state is being handled on both mobile and desktop.
Consolidate behavior of CHANGE_RESOURCE_TYPE and TOGGLE_RESOURCE_TYPE actions into one new action, SET_RESOURCE_TYPE.
Use consistent naming for mobile and desktop resource menu components, and bring to one location.
Currently the isMobile condition occurs on the parent component, and so is not needed in DesktopChooseResource.js.
Just a quick comment on the PR description, is it fair to assume that the second bullet meant to say |
@ravicodelabs - These changes all look great, thank you for bringing them in! Before approving, there was one thing we can talk about on today's meetup with the wider group. Now that the resource menu on mobile is showing, I think it would be good to run |
Yes, this assumption is correct, I've edited the prior comment. |
All makes sense, will work on that change! Also, it looks like the mobile resources menu is broken again (the menu is not showing) on beta.phlask.me, So for reference, the commit timeline for the resource menu breaking and getting fixing then should be: |
On mobile, we close the choose resource modal upon resource selection to conserve screen space.
Share common data between Mobile and Desktop ChooseResourceType components. And, use a more consistent approach and naming for Desktop and Mobile.
cc: @gcardonag The requested update for mobile behavior (to leave the menu open) should be done now. Also, made a few other changes:
|
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 making all of those changes! Approved ✅
This PR replaces the prior PR #430, and addresses issue #422.
The desktop and mobile resource selection modals have been refactored as follows:
toggleResourceMenu
was used with stateisResourceMenuShown
. Now,setToolbarModal
is used and is consistent with how other toolbar modals are shown/hidden.TOGGLE_RESOURCE_TYPE
andCHANGE_RESOURCE_TYPE
in favor of a new action calledSET_SELECTED_PLACE
SET_RESOURCE_TYPE
, which maintains the same functionality, but is named consistent with other actions inactions.js
and is used for both desktop and mobile.ResourceMenu
toMobileChooseResource
, and the analogous desktop component toDesktopChooseResource
, and moved both tosrc/components/ChooseResource
.Also, some miscellaneous clean up was done, in particular:
TypeToggle.js
componentRelated Issues: #422, #401