diff --git a/src/components/RouteListModal.tsx b/src/components/RouteListModal.tsx index d460f46ba..e9346f016 100644 --- a/src/components/RouteListModal.tsx +++ b/src/components/RouteListModal.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Modal, StyleSheet, View } from 'react-native' +import { ActivityIndicator, Modal, StyleSheet, View } from 'react-native' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { Route } from '../../gen/proto/stationapi_pb' import { LED_THEME_BG_COLOR } from '../constants' @@ -40,6 +40,7 @@ const styles = StyleSheet.create({ alignSelf: 'center', marginTop: 12, }, + loading: { marginTop: 12 }, }) const SAFE_AREA_FALLBACK = 32 @@ -100,9 +101,11 @@ export const RouteListModal: React.FC = ({ > {translate('routeSearchTitle')} - {routes.length ? ( + {loading ? ( + + ) : ( - ) : null} + )} diff --git a/src/screens/RouteSearchScreen.tsx b/src/screens/RouteSearchScreen.tsx index 159c1fef9..31504d0d0 100644 --- a/src/screens/RouteSearchScreen.tsx +++ b/src/screens/RouteSearchScreen.tsx @@ -277,11 +277,11 @@ const RouteSearchScreen = () => { [ currentStation?.groupId, navigation, - routesData, selectedStation?.groupId, setLineState, setNavigationState, setStationState, + withoutPassStationRoutes, ] ) @@ -326,16 +326,15 @@ const RouteSearchScreen = () => { - {routesData?.length ? ( - setIsRouteListModalVisible(false)} - onSelect={handleSelect} - /> - ) : null} + + setIsRouteListModalVisible(false)} + onSelect={handleSelect} + /> ) }