Просмотр исходного кода

Loading indicator for first load + dark mode for error page

Alex Trofimov 5 лет назад
Родитель
Сommit
beb315aca5
3 измененных файлов с 13 добавлено и 7 удалено
  1. 5 1
      App.js
  2. 6 4
      ErrorPage.js
  3. 2 2
      ios/una.xcodeproj/project.pbxproj

+ 5 - 1
App.js

@@ -594,7 +594,7 @@ export default class App extends Component<Props> {
                     onLoadStart={this.onWebViewLoadStart.bind(this)}
                     renderError={this.onWebViewRenderError.bind(this)}
                     startInLoadingState={true}
-                    renderLoading={() => <View style={styles.webviewFirstLoad} />}
+                    renderLoading={() => <View style={styles.webviewFirstLoad}><ActivityIndicator size="large" color={useTheme('colors.activityIndicator')} style={styles.webviewFirstLoadIndicator} /></View>}
                 />
         );
         return (
@@ -788,6 +788,10 @@ const styles = new StyleSheet.create({
     webviewFirstLoad: {
         flex: 9999999999,
         backgroundColor: useTheme('colors.background'),
+        justifyContent: 'center', 
+        alignItems: 'center',
+    },
+    webviewFirstLoadIndicator: {
     },
     header: {
         backgroundColor: useTheme('colors.primary'),

+ 6 - 4
ErrorPage.js

@@ -2,6 +2,7 @@
 import React, { Component } from 'react';
 import { StyleSheet } from 'react-native';
 import { View, Container, Text, Icon, Button } from 'native-base';
+import { themeDark, themeLight, useTheme } from './Theme';
 
 class ErrorPage extends React.Component {
     constructor(props) {
@@ -24,16 +25,17 @@ const styles = StyleSheet.create({
     container: {
         alignItems: 'center', 
         justifyContent: 'center', 
-        flex: 999999999999
+        flex: 9999999999,
+        backgroundColor: useTheme('colors.background'),
     },
     icon: {
         fontSize: 100, 
-        color: '#666',
+        color: useTheme('colors.text'),
     },
     text: {
-        color: '#666',
+        color: useTheme('colors.text'),
         marginTop: 20, 
-        marginBottom: 20
+        marginBottom: 20,
     },
     buttonContainer: {
         justifyContent: 'center', 

+ 2 - 2
ios/una.xcodeproj/project.pbxproj

@@ -574,7 +574,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = una/una.entitlements;
-				CURRENT_PROJECT_VERSION = 1501;
+				CURRENT_PROJECT_VERSION = 1502;
 				DEVELOPMENT_TEAM = 235MTP3MJ2;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = una/Info.plist;
@@ -604,7 +604,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = una/una.entitlements;
-				CURRENT_PROJECT_VERSION = 1501;
+				CURRENT_PROJECT_VERSION = 1502;
 				DEVELOPMENT_TEAM = 235MTP3MJ2;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = una/Info.plist;