Faro & OSM #51

Closed
Ichitux wants to merge 7 commits from fix/mobile-view into main
5 changed files with 29 additions and 37 deletions
Showing only changes of commit 795d935413 - Show all commits
+1 -7
View File
@@ -24,13 +24,7 @@
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#007AFF"
},
"package": "com.farmafinder.app",
"googleServicesFile": "./google-services.json",
"config": {
"googleMaps": {
"apiKey": ""
}
}
"package": "com.farmafinder.app"
},
"plugins": [
"expo-router",
+1 -2
View File
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { View, StyleSheet, Text } from 'react-native';
import MapView, { Marker, UrlTile, PROVIDER_DEFAULT } from 'react-native-maps';
import MapView, { Marker, UrlTile } from 'react-native-maps';
import { useRouter } from 'expo-router';
import { getPharmacies } from '../../services/pharmacies';
import { LoadingSpinner } from '../../components/LoadingSpinner';
@@ -54,7 +54,6 @@ export default function MapScreen() {
<View style={styles.container}>
<MapView
style={styles.map}
provider={PROVIDER_DEFAULT}
mapType="none"
region={region}
onRegionChangeComplete={setRegion}
+25 -24
View File
@@ -174,32 +174,33 @@ export default function SearchScreen() {
data={results}
keyExtractor={(item) => item.nregistro}
renderItem={({ item }) => <MedicineCard medicine={item} />}
ListHeaderComponent={
<>
{products.length > 0 && (
<View style={styles.section}>
<Text style={[styles.sectionTitle, { color: colors.text }]}>{t('search.parapharmacy')}</Text>
{products.map((product) => (
<TouchableOpacity
key={`${product.source}-${product.id || product._id}`}
style={[styles.productCard, { backgroundColor: colors.card, borderColor: colors.border }]}
onPress={() => router.push(`/product/${product.source}/${product.id || product._id}`)}
activeOpacity={0.7}
>
<View style={styles.productInfo}>
<View style={styles.badges}>
<View style={[styles.sourceBadge, { backgroundColor: '#16a34a' }]}>
<Text style={styles.badgeText}>{t('search.parapharmacy')}</Text>
</View>
ListEmptyComponent={
products.length === 0 ? null : undefined
}
ListFooterComponent={
products.length > 0 ? (
<View style={styles.section}>
<Text style={[styles.sectionTitle, { color: colors.text }]}>{t('search.parapharmacy')}</Text>
{products.map((product) => (
<TouchableOpacity
key={`${product.source}-${product.id || product._id}`}
style={[styles.productCard, { backgroundColor: colors.card, borderColor: colors.border }]}
onPress={() => router.push(`/product/${product.source}/${product.id || product._id}`)}
activeOpacity={0.7}
>
<View style={styles.productInfo}>
<View style={styles.badges}>
<View style={[styles.sourceBadge, { backgroundColor: '#16a34a' }]}>
<Text style={styles.badgeText}>{t('search.parapharmacy')}</Text>
</View>
<Text style={[styles.productName, { color: colors.text }]} numberOfLines={1}>{product.name}</Text>
<Text style={[styles.productBrand, { color: colors.textSecondary }]} numberOfLines={1}>{product.brand} • {product.price}€</Text>
</View>
</TouchableOpacity>
))}
</View>
)}
</>
<Text style={[styles.productName, { color: colors.text }]} numberOfLines={1}>{product.name}</Text>
<Text style={[styles.productBrand, { color: colors.textSecondary }]} numberOfLines={1}>{product.brand} • {product.price}€</Text>
</View>
</TouchableOpacity>
))}
</View>
) : null
}
contentContainerStyle={[styles.list, isTablet && styles.listTablet]}
showsVerticalScrollIndicator={false}
+1 -2
View File
@@ -3,7 +3,7 @@ import { View, Text, ScrollView, StyleSheet, TouchableOpacity, Linking } from 'r
import { useLocalSearchParams, useRouter } from 'expo-router';
import { Ionicons } from '@expo/vector-icons';
import * as Location from 'expo-location';
import MapView, { Marker, UrlTile, PROVIDER_DEFAULT } from 'react-native-maps';
import MapView, { Marker, UrlTile } from 'react-native-maps';
import { getMedicine, getMedicinePharmacies } from '../../services/medicines';
import { subscribeToMedicine, unsubscribeFromMedicine } from '../../services/notifications';
import { useAuth } from '../../hooks/useAuth';
@@ -209,7 +209,6 @@ export default function MedicineDetailScreen() {
<View style={styles.mapContainer}>
<MapView
style={styles.map}
provider={PROVIDER_DEFAULT}
mapType="none"
initialRegion={{
latitude: mapCenter.latitude,
+1 -2
View File
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import { View, Text, ScrollView, StyleSheet, TouchableOpacity, Linking } from 'react-native';
import { useLocalSearchParams, useRouter } from 'expo-router';
import { Ionicons } from '@expo/vector-icons';
import MapView, { Marker, UrlTile, PROVIDER_DEFAULT } from 'react-native-maps';
import MapView, { Marker, UrlTile } from 'react-native-maps';
import { getPharmacy, getPharmacyMedicines } from '../../services/pharmacies';
import { subscribeToMedicine, unsubscribeFromMedicine } from '../../services/notifications';
import { useAuth } from '../../hooks/useAuth';
@@ -125,7 +125,6 @@ export default function PharmacyDetailScreen() {
<View style={styles.mapContainer}>
<MapView
style={styles.map}
provider={PROVIDER_DEFAULT}
mapType="none"
initialRegion={{
latitude: pharmacy.latitude,