Эх сурвалжийг харах

refactor(home): 优化首页精品服务模块布局

- 在 HomeFeaturesView 组件中添加了一个 content容器,用于更好地组织内容结构
- 调整了 header、DataEmpty 和 items 的层级关系,提高了代码的可读性和可维护性
xuqm 4 өдөр өмнө
parent
commit
05a81e4ff2

+ 34 - 32
src/app/screens/home/home/components/HomeFeaturesView.tsx

@@ -22,39 +22,41 @@ type Props = {
 export default function HomeFeaturesView(props: Props) {
   return (
     <View style={styles.contanier}>
-      <View style={styles.header}>
-        <Image
-          style={styles.background}
-          source={require('@app/assets/images/home/home_section_background.png')}
-        />
-        <Text style={styles.title} numberOfLines={1}>
-          精品服务
-        </Text>
-      </View>
-      {props.error && props.error.type !== 'Cancel' && (
-        <DataEmpty
-          reload={() => {
-            props.reload && props.reload();
-          }}
-        />
-      )}
-      {props.error === undefined && props.features && (
-        <View style={styles.items}>
-          {props.features.map((feature, index) => {
-            return (
-              <FeatureButtons
-                key={index}
-                title={feature.name}
-                image={{ uri: feature.icon }}
-                badge={feature.badge}
-                onPress={() => {
-                  props.onPress && props.onPress(index);
-                }}
-              />
-            );
-          })}
+      <View style={styles.content}>
+        <View style={styles.header}>
+          <Image
+            style={styles.background}
+            source={require('@app/assets/images/home/home_section_background.png')}
+          />
+          <Text style={styles.title} numberOfLines={1}>
+            精品服务
+          </Text>
         </View>
-      )}
+        {props.error && props.error.type !== 'Cancel' && (
+          <DataEmpty
+            reload={() => {
+              props.reload && props.reload();
+            }}
+          />
+        )}
+        {props.error === undefined && props.features && (
+          <View style={styles.items}>
+            {props.features.map((feature, index) => {
+              return (
+                <FeatureButtons
+                  key={index}
+                  title={feature.name}
+                  image={{ uri: feature.icon }}
+                  badge={feature.badge}
+                  onPress={() => {
+                    props.onPress && props.onPress(index);
+                  }}
+                />
+              );
+            })}
+          </View>
+        )}
+      </View>
     </View>
   );
 }