Skip to content

Commit 3354d61

Browse files
authored
Merge pull request #101 from Resgrid/develop
Develop
2 parents 8a53e29 + fec665e commit 3354d61

8 files changed

Lines changed: 61 additions & 30 deletions

File tree

src/components/audio-stream/audio-stream-bottom-sheet.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ import { useColorScheme } from 'nativewind';
44
import React, { useCallback, useEffect } from 'react';
55
import { useTranslation } from 'react-i18next';
66

7+
import { Actionsheet, ActionsheetBackdrop, ActionsheetContent, ActionsheetDragIndicator, ActionsheetDragIndicatorWrapper } from '@/components/ui/actionsheet';
8+
import { Button, ButtonText } from '@/components/ui/button';
9+
import { HStack } from '@/components/ui/hstack';
10+
import { Select, SelectBackdrop, SelectContent, SelectDragIndicator, SelectDragIndicatorWrapper, SelectIcon, SelectInput, SelectItem, SelectPortal, SelectTrigger } from '@/components/ui/select';
711
import { Text } from '@/components/ui/text';
12+
import { VStack } from '@/components/ui/vstack';
813
import { useAnalytics } from '@/hooks/use-analytics';
14+
import { useToast } from '@/hooks/use-toast';
915
import { useAudioStreamStore } from '@/stores/app/audio-stream-store';
1016

11-
import { Actionsheet, ActionsheetBackdrop, ActionsheetContent, ActionsheetDragIndicator, ActionsheetDragIndicatorWrapper } from '../ui/actionsheet';
12-
import { Button, ButtonText } from '../ui/button';
13-
import { HStack } from '../ui/hstack';
14-
import { Select, SelectBackdrop, SelectContent, SelectDragIndicator, SelectDragIndicatorWrapper, SelectIcon, SelectInput, SelectItem, SelectPortal, SelectTrigger } from '../ui/select';
15-
import { VStack } from '../ui/vstack';
16-
1717
export const AudioStreamBottomSheet = () => {
1818
const { t } = useTranslation();
1919
const { colorScheme } = useColorScheme();
2020
const { trackEvent } = useAnalytics();
21+
const toast = useToast();
2122

2223
const { isBottomSheetVisible, setIsBottomSheetVisible, availableStreams, currentStream, isLoadingStreams, isPlaying, isLoading, isBuffering, fetchAvailableStreams, playStream, stopStream } = useAudioStreamStore();
2324

@@ -84,9 +85,11 @@ export const AudioStreamBottomSheet = () => {
8485
});
8586

8687
console.error('Failed to handle stream selection:', error);
88+
89+
toast.error(t('audio_streams.error_loading_stream'));
8790
}
8891
},
89-
[availableStreams, stopStream, playStream, trackEvent, currentStream]
92+
[availableStreams, stopStream, playStream, trackEvent, currentStream, t, toast]
9093
);
9194

9295
const getCurrentStreamValue = () => {
@@ -242,3 +245,4 @@ export const AudioStreamBottomSheet = () => {
242245
</Actionsheet>
243246
);
244247
};
248+

src/components/livekit/livekit-bottom-sheet.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,9 @@ const styles = StyleSheet.create({
333333
},
334334
controls: {
335335
flexDirection: 'row',
336-
justifyContent: 'space-around',
336+
justifyContent: 'space-evenly',
337337
marginTop: 16,
338+
width: '100%',
338339
},
339340
controlButton: {
340341
alignItems: 'center',

src/components/personnel/personnel-card.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,8 @@ export const PersonnelCard: React.FC<PersonnelCardProps> = ({ personnel, onPress
3939
<HStack space="md" className="items-start">
4040
{/* Profile Avatar */}
4141
<Avatar size="md" style={imageError ? { backgroundColor: fallbackColor } : undefined}>
42-
{!imageError && (
43-
<AvatarImage
44-
source={{ uri: avatarUrl }}
45-
onError={() => setImageError(true)}
46-
/>
47-
)}
48-
{imageError && (
49-
<AvatarFallbackText className="text-white">{initials}</AvatarFallbackText>
50-
)}
42+
{!imageError && <AvatarImage source={{ uri: avatarUrl }} onError={() => setImageError(true)} />}
43+
{imageError && <AvatarFallbackText className="text-white">{initials}</AvatarFallbackText>}
5144
</Avatar>
5245

5346
<VStack space="xs" className="flex-1">

src/components/personnel/personnel-details-sheet.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ import { HStack } from '../ui/hstack';
1919
import { Text } from '../ui/text';
2020
import { VStack } from '../ui/vstack';
2121

22-
23-
24-
25-
2622
export const PersonnelDetailsSheet: React.FC = () => {
2723
const { t } = useTranslation();
2824
const { personnel, selectedPersonnelId, isDetailsOpen, closeDetails } = usePersonnelStore();
@@ -98,15 +94,8 @@ export const PersonnelDetailsSheet: React.FC = () => {
9894
<HStack space="md" className="flex-1 items-center">
9995
{/* Profile Avatar */}
10096
<Avatar size="lg" style={imageError ? { backgroundColor: fallbackColor } : undefined}>
101-
{!imageError && (
102-
<AvatarImage
103-
source={{ uri: avatarUrl }}
104-
onError={() => setImageError(true)}
105-
/>
106-
)}
107-
{imageError && (
108-
<AvatarFallbackText className="text-white">{initials}</AvatarFallbackText>
109-
)}
97+
{!imageError && <AvatarImage source={{ uri: avatarUrl }} onError={() => setImageError(true)} />}
98+
{imageError && <AvatarFallbackText className="text-white">{initials}</AvatarFallbackText>}
11099
</Avatar>
111100
<Heading size="lg" className="flex-1 text-gray-800 dark:text-gray-100">
112101
{fullName}

src/stores/app/audio-stream-store.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ export const useAudioStreamStore = create<AudioStreamState>((set, get) => ({
189189
isLoading: false,
190190
isBuffering: false,
191191
});
192+
193+
192194
}
193195
},
194196

src/translations/ar.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"buffering_stream": "جاري التخزين المؤقت للبث الصوتي...",
88
"close": "إغلاق",
99
"currently_playing": "يتم تشغيل حاليًا: {{streamName}}",
10+
"error_loading_stream": "خطأ في تحميل البث الصوتي",
1011
"loading": "جاري التحميل...",
1112
"loading_stream": "جاري تحميل البث الصوتي...",
1213
"loading_streams": "جاري تحميل البثوث الصوتية...",
@@ -764,6 +765,19 @@
764765
"app_info": "معلومات التطبيق",
765766
"app_name": "اسم التطبيق",
766767
"arabic": "عربي",
768+
"audio_device_selection": {
769+
"bluetooth_device": "جهاز بلوتوث",
770+
"current_selection": "الاختيار الحالي",
771+
"microphone": "الميكروفون",
772+
"no_microphones_available": "لا توجد ميكروفونات متاحة",
773+
"no_speakers_available": "لا توجد مكبرات صوت متاحة",
774+
"none_selected": "لم يتم اختيار أي شيء",
775+
"speaker": "مكبر الصوت",
776+
"speaker_device": "مكبر الصوت",
777+
"title": "اختيار جهاز الصوت",
778+
"unavailable": "غير متاح",
779+
"wired_device": "جهاز سلكي"
780+
},
767781
"background_geolocation": "تحديد الموقع الجغرافي في الخلفية",
768782
"background_geolocation_warning": "تسمح هذه الميزة للتطبيق بتتبع موقعك في الخلفية. تساعد في تنسيق الاستجابة للطوارئ ولكن قد تؤثر على عمر البطارية.",
769783
"background_location": "الموقع في الخلفية",

src/translations/en.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"buffering_stream": "Buffering audio stream...",
88
"close": "Close",
99
"currently_playing": "Currently playing: {{streamName}}",
10+
"error_loading_stream": "Failed to load audio stream",
1011
"loading": "Loading",
1112
"loading_stream": "Loading audio stream...",
1213
"loading_streams": "Loading audio streams...",
@@ -764,6 +765,19 @@
764765
"app_info": "App Info",
765766
"app_name": "App Name",
766767
"arabic": "Arabic",
768+
"audio_device_selection": {
769+
"bluetooth_device": "Bluetooth Device",
770+
"current_selection": "Current Selection",
771+
"microphone": "Microphone",
772+
"no_microphones_available": "No microphones available",
773+
"no_speakers_available": "No speakers available",
774+
"none_selected": "None Selected",
775+
"speaker": "Speaker",
776+
"speaker_device": "Speaker",
777+
"title": "Audio Device Selection",
778+
"unavailable": "Unavailable",
779+
"wired_device": "Wired Device"
780+
},
767781
"background_geolocation": "Background Geolocation",
768782
"background_geolocation_warning": "This feature allows the app to track your location in the background. It helps with emergency response coordination but may impact battery life.",
769783
"background_location": "Background Location",

src/translations/es.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"buffering_stream": "Almacenando transmisión de audio en búfer...",
88
"close": "Cerrar",
99
"currently_playing": "Reproduciendo actualmente: {{streamName}}",
10+
"error_loading_stream": "Error al cargar la transmisión",
1011
"loading": "Cargando",
1112
"loading_stream": "Cargando transmisión de audio...",
1213
"loading_streams": "Cargando transmisiones de audio...",
@@ -764,6 +765,19 @@
764765
"app_info": "Información de la aplicación",
765766
"app_name": "Nombre de la aplicación",
766767
"arabic": "Árabe",
768+
"audio_device_selection": {
769+
"bluetooth_device": "Dispositivo Bluetooth",
770+
"current_selection": "Selección Actual",
771+
"microphone": "Micrófono",
772+
"no_microphones_available": "No hay micrófonos disponibles",
773+
"no_speakers_available": "No hay altavoces disponibles",
774+
"none_selected": "Ninguno Seleccionado",
775+
"speaker": "Altavoz",
776+
"speaker_device": "Altavoz",
777+
"title": "Selección de Dispositivo de Audio",
778+
"unavailable": "No disponible",
779+
"wired_device": "Dispositivo Cableado"
780+
},
767781
"background_geolocation": "Geolocalización en segundo plano",
768782
"background_geolocation_warning": "Esta función permite que la aplicación rastree tu ubicación en segundo plano. Ayuda con la coordinación de respuesta de emergencia pero puede impactar la duración de la batería.",
769783
"background_location": "Ubicación en segundo plano",

0 commit comments

Comments
 (0)