fix(mobile): align background, API config, and search bar with PWA
Run Tests on Branches / Detect Changes (push) Successful in 11s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m46s

- Add background image matching PWA (bg.png with opacity + overlay)
- Fix production API URL to farmacias.hacecalor.net
- Replace raw fetch calls in alerts.tsx with configured api service
- Constrain SearchBar max-width to 420px to prevent horizontal clipping
This commit is contained in:
Antoni Nuñez Romeu
2026-07-08 14:23:58 +02:00
parent a3cea35b13
commit d6db48b695
6 changed files with 35 additions and 11 deletions
+5 -9
View File
@@ -3,6 +3,7 @@ import { View, Text, StyleSheet, FlatList, TouchableOpacity, Alert, useWindowDim
import { Ionicons } from '@expo/vector-icons';
import { colors, spacing, borderRadius, shadows } from '../../constants/theme';
import { LoadingSpinner } from '../../components/LoadingSpinner';
import api from '../../services/api';
const TABLET_MIN_WIDTH = 768;
@@ -33,9 +34,8 @@ export default function AlertsScreen() {
setIsLoading(true);
setError(null);
try {
const res = await fetch('/api/notifications/mine', { credentials: 'include' });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
const res = await api.get('/notifications/mine');
const data = res.data;
const merged = [
...(data.pharmacy || []),
...(data.global || []),
@@ -63,13 +63,9 @@ export default function AlertsScreen() {
onPress: async () => {
setDeletingId(key);
try {
const res = await fetch('/api/notifications/mine', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ scope: item.scope, id: item.id }),
await api.delete('/notifications/mine', {
data: { scope: item.scope, id: item.id },
});
if (!res.ok && res.status !== 204) throw new Error(`HTTP ${res.status}`);
setItems(prev => prev.filter(i => !(i.scope === item.scope && i.id === item.id)));
} catch (err: any) {
Alert.alert('Error', err.message || 'No se pudo eliminar');
+4 -1
View File
@@ -100,7 +100,10 @@ const styles = StyleSheet.create({
searchContainer: {
flexDirection: 'row',
alignItems: 'center',
paddingRight: spacing.lg,
paddingHorizontal: spacing.lg,
maxWidth: 480,
alignSelf: 'center',
width: '100%',
},
searchContainerTablet: {
maxWidth: 700,