Skip to content

Commit 7f9f95b

Browse files
committed
fix: gym range color should dynamically update
1 parent 0e5dd44 commit 7f9f95b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/features/gym/GymTile.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ const BaseGymTile = (gym) => {
154154
? gym.raid_end_timestamp
155155
: gym.raid_battle_timestamp
156156

157+
const rangePathOptions = React.useMemo(
158+
() => ({ color: getColor(gym.team_id), weight: 0.5 }),
159+
[gym.team_id],
160+
)
161+
157162
useForcePopup(gym.id, markerRef)
158163
useMarkerTimer(timerToDisplay, markerRef, () => setStateChange(!stateChange))
159164
const handlePopupOpen = useManualPopupTracker('gyms', gym.id)
@@ -214,16 +219,14 @@ const BaseGymTile = (gym) => {
214219
<Circle
215220
center={[gym.lat, gym.lon]}
216221
radius={80}
217-
color={getColor(gym.team_id)}
218-
weight={0.5}
222+
pathOptions={rangePathOptions}
219223
/>
220224
)}
221225
{!!customRange && (
222226
<Circle
223227
center={[gym.lat, gym.lon]}
224228
radius={customRange}
225-
color={getColor(gym.team_id)}
226-
weight={0.5}
229+
pathOptions={rangePathOptions}
227230
/>
228231
)}
229232
</Marker>

0 commit comments

Comments
 (0)