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

refactor: Map new architecture PoC #4785

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

gorandalum
Copy link
Member

@gorandalum gorandalum commented Oct 29, 2024

PoC for this architecture:
Map refactor

@gorandalum gorandalum self-assigned this Oct 29, 2024
Comment on lines +17 to +19
useEffect(() => {
if (region) updateRegion?.(region);
}, [region, updateRegion]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the tile server + vector source is in place, we can completely remove the updateRegion stuff :)

Comment on lines +25 to +36
openBottomSheet(() => {
return (
<ScooterSheet
vehicleId={scooterFeature.properties.id}
onClose={() => {
setSharedState({selectedEntityId: undefined});
closeBottomSheet();
}}
onReportParkingViolation={() => {}}
/>
);
}, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is something very "un-react" about calling functions like this.
I would prefer dispatching an action that would set the app in the desired state 🤔

@marius-at-atb
Copy link
Contributor

An interesting approach!
I guess the onPress handling is the main advantage of the plugin setup as it is now.
However I'm not sure if that's worth it compared to using components directly that depend on shared state, and having a unified onPress handler 🤔
As the complexity of the BottomSheet usage increases (and also its coordination with the map), I suspect reducer state management can be valuable.
I think it's a good idea to also try an example implementation of that approach, and see what works best.

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

Successfully merging this pull request may close these issues.

2 participants