Mobile App design
Run Tests on Branches / Detect Changes (push) Successful in 10s
Run Tests on Branches / Backend Tests (push) Successful in 2m12s
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m47s

This commit is contained in:
Ichitux
2026-07-09 13:33:54 +02:00
parent 5f604b11ba
commit 2f36ef685d
32 changed files with 1793 additions and 926 deletions
+6 -7
View File
@@ -4,15 +4,17 @@ import MapView, { Marker } from 'react-native-maps';
import { useRouter } from 'expo-router';
import { getPharmacies } from '../../services/pharmacies';
import { LoadingSpinner } from '../../components/LoadingSpinner';
import { colors, spacing, borderRadius } from '../../constants/theme';
import { useThemeContext } from '../../components/ThemeProvider';
import { spacing, borderRadius } from '../../constants/theme';
import { Pharmacy } from '../../types';
export default function MapScreen() {
const router = useRouter();
const { colors } = useThemeContext();
const [pharmacies, setPharmacies] = useState<Pharmacy[]>([]);
const [isLoading, setIsLoading] = useState(true);
const [region, setRegion] = useState({
latitude: 40.4168, // Madrid default
latitude: 40.4168,
longitude: -3.7038,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
@@ -24,7 +26,6 @@ export default function MapScreen() {
const data = await getPharmacies();
setPharmacies(data);
// Center map on first pharmacy if available
if (data.length > 0) {
setRegion({
latitude: data[0].latitude,
@@ -70,8 +71,8 @@ export default function MapScreen() {
))}
</MapView>
<View style={styles.legend}>
<Text style={styles.legendText}>
<View style={[styles.legend, { backgroundColor: colors.card }]}>
<Text style={[styles.legendText, { color: colors.text }]}>
{pharmacies.length} farmacias en el mapa
</Text>
</View>
@@ -91,7 +92,6 @@ const styles = StyleSheet.create({
bottom: spacing.lg,
left: spacing.md,
right: spacing.md,
backgroundColor: colors.card,
borderRadius: borderRadius.lg,
padding: spacing.sm + 4,
alignItems: 'center',
@@ -103,6 +103,5 @@ const styles = StyleSheet.create({
},
legendText: {
fontSize: 14,
color: colors.text,
},
});