Kaynağa Gözat

Improve theme configuration

vbea 2 yıl önce
ebeveyn
işleme
c45ab9395e

+ 2 - 2
Strides-APP/app/pages/alert/Notification.js

@@ -50,8 +50,8 @@ export default class Notification extends Component {
       tabBarPressColor: rippleColor,
       tabBarScrollEnabled: false,
       tabBarIndicatorStyle: styles.indicator,
-      tabBarActiveTintColor: app.isWhitelabel ? textPrimary : colorLight,
-      tabBarInactiveTintColor: app.isWhitelabel ? textSecondary : "#E0E0E0"
+      tabBarActiveTintColor: tabBarTextActive,
+      tabBarInactiveTintColor: tabBarTextInactive
     }
     this.isHide = false;
   }

+ 3 - 3
Strides-APP/app/pages/chargeV2/ChargeAdapter.js

@@ -46,7 +46,7 @@ export default class ChargeAdapter extends Component {
       title: $t('charging.tabReserve'),
       name: "Reserve",
       component: Reserve
-    }, {
+    }/*, {
       title: $t('charging.tabExplore'),
       name: "Explore",
       component: Explore
@@ -56,8 +56,8 @@ export default class ChargeAdapter extends Component {
       tabBarPressColor: rippleColor,
       tabBarScrollEnabled: this.pageAdapter.length > 3,
       tabBarIndicatorStyle: styles.indicator,
-      tabBarActiveTintColor: app.isWhitelabel ? textPrimary : colorLight,
-      tabBarInactiveTintColor: app.isWhitelabel ? textSecondary : "#E0E0E0"
+      tabBarActiveTintColor: tabBarTextActive,
+      tabBarInactiveTintColor: tabBarTextInactive
     }
     this.action = "";
     this.isHide = false;

+ 2 - 2
Strides-APP/app/pages/home/Drawer.js

@@ -55,13 +55,13 @@ export default DrawerView = ({isLogin=false, userInfo, onLogout, notificationCou
   return (
     <View style={styles.drawerView}>
       <View style={styles.loginView}>
-        { (isLogin && userInfo.photoUrl)
+        { userInfo.photoUrl
         ? <TouchableWithoutFeedback onPress={() => startPage(PageList.profile)}>
             <Image
               style={styles.avatar}
               source={{uri: utils.getImageUrl(userInfo.photoUrl)}}/>
           </TouchableWithoutFeedback>
-        : <TouchableWithoutFeedback onPress={() => startPage(PageList.login)}>
+        : <TouchableWithoutFeedback onPress={() => startPage(isLogin ? PageList.profile : PageList.login)}>
             <Image
               style={styles.avatar}
               source={require('../../images/user/ic-avatar-default.png')}/>

+ 1 - 1
Strides-APP/app/pages/home/Home.js

@@ -68,7 +68,7 @@ export default class HomePage extends Component {
       //toastShort('onStop')
       this.isHide = true;
       if (!app.isWhitelabel) {
-        MyStatusBar.setStatusBarThemes(MyStatusBar.LIGHT_STYLE, colorPrimaryDark);
+        MyStatusBar.setStatusBarThemes(themeStatusBar, colorPrimaryDark); 
       }
       setTimeout(() => {
         navigation.closeDrawer();

+ 1 - 1
Strides-APP/app/pages/my/ProfileV2.js

@@ -345,7 +345,7 @@ export default class ProfileV2 extends Component {
         <Button
           style={styles.deleteButton}
           text={$t('profile.logout')}
-          textColor={textButton}
+          textColor={textLight}
           onClick={() => this.logout()}
         />
       </ScrollView>

+ 18 - 18
Strides-APP/app/pages/sign/ResetPasswordV2.js

@@ -94,18 +94,18 @@ export default class ResetPassword extends Component {
   sendVerification() {
     var info = this.formInfo;
     if (!info.email) {
-      toastShort('Please enter email address');
+      toastShort($t('sign.plsInputEmail'));
       return;
     }
     if (!/^[a-zA-Z0-9]+[\S]+@[a-zA-Z0-9_-]+[\.][\Sa-zA-Z]+$/.test(info.email)) {
-      toastShort('Email is incorrect format');
+      toastShort($t('sign.errEmailFormat'));
       return;
     }
     Dialog.showProgressDialog()
     apiUser.sendVerificationCode(info.email).then(res => {
       Dialog.dismissLoading()
       this.state.sendMinutes = res.data?.resendTime ?? 60;
-      toastShort('Send verification code successfully');
+      toastShort($t('sign.sendOTPSuccess'));
       this.contdownTime();
     }).catch(err => {
       Dialog.dismissLoading()
@@ -128,37 +128,37 @@ export default class ResetPassword extends Component {
     var info = this.formInfo;
     console.log('reset info', info);
     if (!info.email) {
-      toastShort('Please enter email address');
+      toastShort($t('sign.plsInputEmail'));
       return;
     }
     if (!/^[a-zA-Z0-9]+[\S]+@[a-zA-Z0-9_-]+[\.][\Sa-zA-Z]+$/.test(info.email)) {
-      toastShort('Email is incorrect format');
+      toastShort($t('sign.errEmailFormat'));
       return;
     }
     if (!this.state.password) {
-      toastShort('Please enter password');
+      toastShort($t('sign.plsInputPassword'));
       return;
     }
     if (this.state.strength < this.StrengthView.maxStrength) {
-      toastShort('Password is not strong');
+      toastShort($t('sign.errPasswordStrong'));
       return;
     }
     if (!info.password) {
-      toastShort('Please enter confirm password');
+      toastShort($t('sign.plsInputPassword2'));
       return;
     }
     if (info.password != this.state.password) {
-      toastShort('The twice passwords are inconsistent');
+      toastShort($t('sign.errPasswordConfirm'));
       return;
     }
     if (!info.verificationCode) {
-      toastShort('Please enter verification code');
+      toastShort($t('sign.plsInputOTP'));
       return;
     }
     Dialog.showProgressDialog()
     apiUser.updatePassword(this.formInfo).then(res => {
       Dialog.dismissLoading()
-      toastShort('Reset password successfully');
+      toastShort($t('sign.resetPasswordSuccess'));
       if (this.isChange) {
         this.requestLogout();
       } else {
@@ -221,7 +221,7 @@ export default class ResetPassword extends Component {
               />
               <TextInput
                 style={styles.inputView}
-                placeholder='Email Address'
+                placeholder={$t('sign.labelEmail')}
                 placeholderTextColor={textPlacehoder}
                 maxLength={50}
                 keyboardType="email-address"
@@ -238,7 +238,7 @@ export default class ResetPassword extends Component {
               />
               <TextInput
                 style={[styles.inputView, {flex: 2.6, marginLeft: 2}]}
-                placeholder='OTP'
+                placeholder={$t('sign.labelOtp')}
                 placeholderTextColor={textPlacehoder}
                 maxLength={6}
                 keyboardType="number-pad"
@@ -246,7 +246,7 @@ export default class ResetPassword extends Component {
                 onChangeText={v => this.changeInfo('verificationCode', v)}
               />
               <Button
-                text={this.state.sendMinutes > 0 ? (this.state.sendMinutes + " s") : 'EMAIL OTP'}
+                text={this.state.sendMinutes > 0 ? (this.state.sendMinutes + " s") : $t('sign.btnSendOTP')}
                 style={styles.sendBtn}
                 disabled={this.state.sendMinutes > 0}
                 viewStyle={styles.sendBtnView}
@@ -263,7 +263,7 @@ export default class ResetPassword extends Component {
               <TextInput
                 secureTextEntry={this.state.wrongCount}
                 style={styles.inputView}
-                placeholder='New Password'
+                placeholder={$t('sign.labelNewPassword')}
                 placeholderTextColor={textPlacehoder}
                 maxLength={20}
                 onChangeText={(value) => this.applyStrength(value)}
@@ -303,14 +303,14 @@ export default class ResetPassword extends Component {
               <TextInput
                 secureTextEntry={this.state.wrongCount}
                 style={styles.inputView}
-                placeholder='Confirm Password'
+                placeholder={$t('sign.labelConfirmPassword')}
                 placeholderTextColor={textPlacehoder}
                 maxLength={20}
                 onChangeText={v => this.changeInfo('password', v)}
               />
             </View>
             <Button
-              text='Confirm'
+              text={$t('common.confirm')}
               style={styles.resetButton}
               onClick={() => this.onResetPassword()}
             />
@@ -423,7 +423,7 @@ const styles = StyleSheet.create({
     justifyContent: 'center'
   },
   sendBtnText: {
-    color: colorLight,
+    color: textButton,
     fontSize: 13,
     fontWeight: 'bold'
   },

+ 3 - 0
Strides-APP/app/utils/themes.js

@@ -8,6 +8,9 @@ global.colorThemes = '#FFFFFF';//toolbar color
 global.colorAccent = '#A3C93A';//56D905
 global.colorPrimary = '#001489';
 global.colorPrimaryDark = '#FFFFFF';//statusbar color
+//tab bar
+global.tabBarTextActive = '#000000';//fff
+global.tabBarTextInactive = '#666666';//e0e0e0
 //background
 global.colorDark = "#303030";
 global.colorLight = "#FFFEFE";