Skip to content

Commit

Permalink
ローディング系の改善
Browse files Browse the repository at this point in the history
  • Loading branch information
TinyKitten committed Oct 13, 2024
1 parent 89919fc commit 838799c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
9 changes: 2 additions & 7 deletions src/components/Loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { CommonActions, useNavigation } from '@react-navigation/native'
import React from 'react'
import {
ActivityIndicator,
Dimensions,
Linking,
Pressable,
StyleSheet,
Expand All @@ -15,13 +14,9 @@ import { APP_THEME } from '../models/Theme'
import { translate } from '../translation'
import Typography from './Typography'

const { width: windowWidth, height: windowHeight } = Dimensions.get('window')

const styles = StyleSheet.create({
loading: {
position: 'absolute',
width: windowWidth,
height: windowHeight,
...StyleSheet.absoluteFillObject,
left: 0,
top: 0,
justifyContent: 'center',
Expand All @@ -32,7 +27,7 @@ const styles = StyleSheet.create({
textAlign: 'center',
fontWeight: 'bold',
alignSelf: 'center',
bottom: windowHeight / 3,
bottom: '33.33%',
fontSize: RFValue(14),
},
additionalLinkButton: {
Expand Down
19 changes: 3 additions & 16 deletions src/components/RouteListModal.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { ConnectError } from '@connectrpc/connect'
import React from 'react'
import {
ActivityIndicator,
Modal,
SafeAreaView,
StyleSheet,
View,
} from 'react-native'
import { Modal, SafeAreaView, 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'
Expand All @@ -16,6 +10,7 @@ import { translate } from '../translation'
import isTablet from '../utils/isTablet'
import FAB from './FAB'
import Heading from './Heading'
import Loading from './Loading'
import { RouteList } from './RouteList'

type Props = {
Expand Down Expand Up @@ -119,15 +114,7 @@ export const RouteListModal: React.FC<Props> = ({
}}
>
{isRoutesLoading ? (
<View
style={{
...StyleSheet.absoluteFillObject,
justifyContent: 'center',
alignItems: 'center',
}}
>
<ActivityIndicator size="large" />
</View>
<Loading message={translate('loadingAPI')} />
) : (
<View
style={{ flex: 1, opacity: isTrainTypesLoading ? 0.5 : 1 }}
Expand Down
10 changes: 9 additions & 1 deletion src/screens/FakeStationSettingsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,15 @@ const FakeStationSettingsScreen: React.FC = () => {
onKeyPress={onKeyPress}
/>
{isByCoordsLoading || byNameFetchStatus === 'pending' ? (
<ActivityIndicator size="large" />
<View
style={{
...StyleSheet.absoluteFillObject,
justifyContent: 'center',
alignItems: 'center',
}}
>
<ActivityIndicator size="large" />
</View>
) : (
<StationList
withoutTransfer
Expand Down

0 comments on commit 838799c

Please sign in to comment.