From 63c082bb8ffea0898c99dc7f3c2a0b88a74d27c5 Mon Sep 17 00:00:00 2001 From: mudabbir-ahmad Date: Thu, 9 Apr 2026 08:44:37 +0100 Subject: [PATCH] Enhance map functionality: improve cache marker rendering for consistency across platforms, especially for iphone users, add fallback for proximity detection when heading is unavailable, and refactor visibility logic for better performance --- src/components/gameplay/CacheCardItem.js | 18 ++++-- src/components/gameplay/PlayerMapView.js | 50 +++++++++++++++-- src/components/screens/ExpandedMapScreen.js | 61 +++++++++++++++++---- src/components/screens/MapScreen.js | 34 +++++++----- src/hooks/usePlayerGame.js | 24 +++++--- 5 files changed, 144 insertions(+), 43 deletions(-) diff --git a/src/components/gameplay/CacheCardItem.js b/src/components/gameplay/CacheCardItem.js index b3ffcd4..519fb1e 100644 --- a/src/components/gameplay/CacheCardItem.js +++ b/src/components/gameplay/CacheCardItem.js @@ -2,7 +2,7 @@ import {StyleSheet, Text, View} from 'react-native'; import Card from '../UI/Card'; import {Button} from '../UI/Button'; -const CacheCardItem = ({cache, isAdmin, isClaimed, isSelected, onEdit, onDelete, onSelect}) => { +const CacheCardItem = ({cache, isAdmin, isClaimed, isSelected, onEdit, onDelete, onSelect, disabled}) => { // Initialisation ------------- const displayName = cache.name || cache.clue || 'Unnamed Cache'; @@ -12,16 +12,16 @@ const CacheCardItem = ({cache, isAdmin, isClaimed, isSelected, onEdit, onDelete, // View ----------------------- return ( - + - {displayName} + {displayName} {cache.name ? ( {cache.clue} ) : null} {/* Players see team-specific claim status; admins see no status */} - {!isAdmin && ( + {!isAdmin && !disabled && ( {isClaimed ? 'Claimed' : 'Available'} @@ -43,6 +43,14 @@ const CacheCardItem = ({cache, isAdmin, isClaimed, isSelected, onEdit, onDelete, styleLabel={styles.btnLabel} /> + ) : disabled ? ( +