Explorar el Código

perf: 修复样式乱的问题以及用户协议多语言配置

kuns hace 1 mes
padre
commit
ab5b038eea

+ 31 - 20
component/accountPages/userTermsPageComponent.tsx

@@ -4,6 +4,7 @@ import { SafeAreaView } from 'react-native-safe-area-context';
 import { router } from 'expo-router';
 import { CrossLogoSvg, RightArrowIconSvg } from '../global/SVG';
 import NormalButton from '../global/normal_button';
+import { useTranslation } from '../../util/hooks/useTranslation';
 
 type TermsSectionProps = {
   title: string| undefined;
@@ -23,6 +24,8 @@ const TermsSection: React.FC<TermsSectionProps> = ({ title, clauses }) => (
   </View>
 );
 const UserTermsPageComponent: React.FC = () => {
+  const { getCurrentLanguageConfig } = useTranslation()
+  const curren = getCurrentLanguageConfig()
   const sectionsZh = [
     {
       clauses: [
@@ -193,26 +196,34 @@ const UserTermsPageComponent: React.FC = () => {
     <SafeAreaView className="flex-1 bg-white" edges={['top', 'right', 'left']}>
     <View style={styles.container}>
       <ScrollView contentContainerStyle={styles.scrollContainer}>
-        <Text style={styles.header}>Crazy Charge 用戶條款及細則</Text>
-        <View style={styles.section}>
-          {sectionsZh.map((section, index) => (
-            <TermsSection 
-              key={index}
-              title={section.title}
-              clauses={section.clauses}
-            />
-          ))}
-        </View>
-        <Text style={styles.header}>Crazy Charge Users’ Terms and Conditions</Text>
-        <View style={styles.section}>
-          {sectionsEn.map((section, index) => (
-            <TermsSection 
-              key={index}
-              title={section.title}
-              clauses={section.clauses}
-            />
-          ))}
-        </View>
+        {curren?.value?
+        <View>
+          <Text style={styles.header}>Crazy Charge 用戶條款及細則</Text>
+            <View style={styles.section}>
+              {sectionsZh.map((section, index) => (
+                <TermsSection 
+                  key={index}
+                  title={section.title}
+                  clauses={section.clauses}
+                />
+              ))}
+            </View>
+          </View>
+          :
+          <View>
+            <Text style={styles.header}>Crazy Charge Users’ Terms and Conditions</Text>
+            <View style={styles.section}>
+              {sectionsEn.map((section, index) => (
+                <TermsSection 
+                  key={index}
+                  title={section.title}
+                  clauses={section.clauses}
+                />
+              ))}
+            </View>
+          </View>
+        }
+
       </ScrollView>
       <NormalButton
         extendedStyle={styles.agreeButton}

+ 2 - 2
component/resultDetailPage/resultDetailPageComponent.tsx

@@ -351,14 +351,14 @@ const styles = StyleSheet.create({
         color: '#000000'
     },
     leftLable: {
-        width: 160,
+        width: '65%',
         fontSize: 17,
         color:'#000000',
         textAlign: 'center'
     },
     rightLable: {
         fontSize: 17,
-        width: 100,
+        width: '30%',
         textAlign: 'center',
         borderLeftWidth: 1,
         paddingLeft: 0,