-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Kevin 385 active pin #569
base: develop
Are you sure you want to change the base?
Kevin 385 active pin #569
Conversation
Conditionally render PinWaterActive for WATER resources at selected location Updated icon source based on resource type and coordinates match Used fallback to default marker icon if no match
Updated logic to display active icons for selected resources. Ensured unselected resources use the default marker icons.
I'll give this PR a look shortly 👀 |
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 just addressed the merge conflicts to get the updated code working with the larger changes. Since an eslint check did not like the use of nested ternaries (https://eslint.org/docs/latest/rules/no-nested-ternary) when setting the active icon URLs, I made a small adjustment to try and improve readability.
However, I think we can simplify things further by addressing the note I left for how the Active Icons are currently produced
switch (resource.resource_type) { | ||
case 'WATER': | ||
return PinWaterActive(); | ||
case 'FOOD': | ||
return PinFoodActive(); | ||
case 'FORAGE': | ||
return PinForagingActive(); | ||
case 'BATHROOM': | ||
return PinBathroomActive(); |
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.
@icycoldveins , could you consolidate the Pin*Active files into a single file, similar to PhlaskMarkerIconV2.js and how it handles the resource type as an input parameter? That would help with consistency in this section
Sounds good I’ll work on that
…On Sun, Feb 16, 2025 at 9:55 PM Gabriel Cardona ***@***.***> wrote:
***@***.**** commented on this pull request.
I just addressed the merge conflicts to get the updated code working with
the larger changes. Since an eslint check did not like the use of nested
ternaries (https://eslint.org/docs/latest/rules/no-nested-ternary) when
setting the active icon URLs, I made a small adjustment to try and improve
readability.
However, I think we can simplify things further by addressing the note I
left for how the Active Icons are currently produced
------------------------------
In src/components/ReactGoogleMaps/ReactGoogleMaps.jsx
<#569 (comment)>:
> + switch (resource.resource_type) {
+ case 'WATER':
+ return PinWaterActive();
+ case 'FOOD':
+ return PinFoodActive();
+ case 'FORAGE':
+ return PinForagingActive();
+ case 'BATHROOM':
+ return PinBathroomActive();
@icycoldveins <https://github.com/icycoldveins> , could you consolidate
the Pin*Active files into a single file, similar to PhlaskMarkerIconV2.js
and how it handles the resource type as an input parameter? That would help
with consistency in this section
—
Reply to this email directly, view it on GitHub
<#569 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATNHJNMI56F5OP4UJ73HVWL2QFFSVAVCNFSM6AAAAABWDCVPWKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMJZHA3TKMRVGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Pull Request
Change Summary
• Refactored map marker icon logic to differentiate between active and default states based on resource selection.
• Implemented dynamic icon switching using a conditional CASE structure for resource types such as Water, Foraging, Bathroom, and Food.
• Updated the logic to assign active icons when a resource is selected and default icons when unselected.
Change Reason
• This change improves user experience by providing clear visual cues for selected and unselected resources on the map.
• By distinguishing between active and default icons, users can more easily identify the selected resources and their types.