From 2fac0b8093b842ba5b7cee19624c7d77352a0481 Mon Sep 17 00:00:00 2001 From: MinhNN Date: Fri, 31 Oct 2025 17:38:48 +0700 Subject: [PATCH] update table --- components/tripInfo/CrewListTable.tsx | 16 +----- components/tripInfo/FishingToolsList.tsx | 19 +------ components/tripInfo/NetListTable.tsx | 53 ++----------------- components/tripInfo/TripCostTable.tsx | 17 +----- .../tripInfo/style/NetListTable.styles.ts | 13 ++--- 5 files changed, 14 insertions(+), 104 deletions(-) diff --git a/components/tripInfo/CrewListTable.tsx b/components/tripInfo/CrewListTable.tsx index 3577af0..00544f3 100644 --- a/components/tripInfo/CrewListTable.tsx +++ b/components/tripInfo/CrewListTable.tsx @@ -1,13 +1,6 @@ import { IconSymbol } from "@/components/ui/icon-symbol"; import React, { useRef, useState } from "react"; -import { - Animated, - Platform, - Text, - TouchableOpacity, - UIManager, - View, -} from "react-native"; +import { Animated, Text, TouchableOpacity, View } from "react-native"; import styles from "./style/CrewListTable.styles"; // --------------------------- @@ -35,13 +28,6 @@ const data: CrewMember[] = [ ]; const CrewListTable: React.FC = () => { - if ( - Platform.OS === "android" && - UIManager.setLayoutAnimationEnabledExperimental - ) { - UIManager.setLayoutAnimationEnabledExperimental(true); - } - const [collapsed, setCollapsed] = useState(true); const [contentHeight, setContentHeight] = useState(0); const animatedHeight = useRef(new Animated.Value(0)).current; diff --git a/components/tripInfo/FishingToolsList.tsx b/components/tripInfo/FishingToolsList.tsx index 6abbe06..00fcbde 100644 --- a/components/tripInfo/FishingToolsList.tsx +++ b/components/tripInfo/FishingToolsList.tsx @@ -1,13 +1,6 @@ -import { IconSymbol } from "@/components/ui/icon-symbol"; // biểu tượng giống dự án bạn +import { IconSymbol } from "@/components/ui/icon-symbol"; import React, { useRef, useState } from "react"; -import { - Animated, - Platform, - Text, - TouchableOpacity, - UIManager, - View, -} from "react-native"; +import { Animated, Text, TouchableOpacity, View } from "react-native"; import styles from "./style/FishingToolsTable.styles"; // --------------------------- @@ -29,14 +22,6 @@ const data: ToolItem[] = [ ]; const FishingToolsTable: React.FC = () => { - // Bật animation trên Android - if ( - Platform.OS === "android" && - UIManager.setLayoutAnimationEnabledExperimental - ) { - UIManager.setLayoutAnimationEnabledExperimental(true); - } - const [collapsed, setCollapsed] = useState(true); const [contentHeight, setContentHeight] = useState(0); const animatedHeight = useRef(new Animated.Value(0)).current; diff --git a/components/tripInfo/NetListTable.tsx b/components/tripInfo/NetListTable.tsx index 90d6b24..6e097f4 100644 --- a/components/tripInfo/NetListTable.tsx +++ b/components/tripInfo/NetListTable.tsx @@ -1,13 +1,6 @@ import { IconSymbol } from "@/components/ui/icon-symbol"; import React, { useRef, useState } from "react"; -import { - Animated, - Platform, - Text, - TouchableOpacity, - UIManager, - View, -} from "react-native"; +import { Animated, Text, TouchableOpacity, View } from "react-native"; import styles from "./style/NetListTable.styles"; // --------------------------- @@ -29,14 +22,6 @@ const data: NetItem[] = [ ]; const NetListTable: React.FC = () => { - // Bật animation cho Android - if ( - Platform.OS === "android" && - UIManager.setLayoutAnimationEnabledExperimental - ) { - UIManager.setLayoutAnimationEnabledExperimental(true); - } - const [collapsed, setCollapsed] = useState(true); const [contentHeight, setContentHeight] = useState(0); const animatedHeight = useRef(new Animated.Value(0)).current; @@ -81,35 +66,21 @@ const NetListTable: React.FC = () => { > {/* Header */} - STT + STT Trạng thái - - Thao tác - {/* Body */} {data.map((item) => ( {/* Cột STT */} - {item.stt} + {item.stt} {/* Cột Trạng thái */} {item.trangThai} - - {/* Cột Thao tác */} - - - - ))} @@ -118,35 +89,21 @@ const NetListTable: React.FC = () => { {/* Header */} - STT + STT Trạng thái - - Thao tác - {/* Body */} {data.map((item) => ( {/* Cột STT */} - {item.stt} + {item.stt} {/* Cột Trạng thái */} {item.trangThai} - - {/* Cột Thao tác */} - - - - ))} diff --git a/components/tripInfo/TripCostTable.tsx b/components/tripInfo/TripCostTable.tsx index b3e4ca8..cb1baaa 100644 --- a/components/tripInfo/TripCostTable.tsx +++ b/components/tripInfo/TripCostTable.tsx @@ -1,13 +1,6 @@ import { IconSymbol } from "@/components/ui/icon-symbol"; import React, { useRef, useState } from "react"; -import { - Animated, - Platform, - Text, - TouchableOpacity, - UIManager, - View, -} from "react-native"; +import { Animated, Text, TouchableOpacity, View } from "react-native"; import styles from "./style/TripCostTable.styles"; // --------------------------- @@ -65,14 +58,6 @@ const data: CostItem[] = [ // --------------------------- const TripCostTable: React.FC = () => { - // Enable LayoutAnimation for Android - if ( - Platform.OS === "android" && - UIManager.setLayoutAnimationEnabledExperimental - ) { - UIManager.setLayoutAnimationEnabledExperimental(true); - } - const [collapsed, setCollapsed] = useState(true); const [contentHeight, setContentHeight] = useState(0); const animatedHeight = useRef(new Animated.Value(0)).current; diff --git a/components/tripInfo/style/NetListTable.styles.ts b/components/tripInfo/style/NetListTable.styles.ts index 67adf6c..fa2fd10 100644 --- a/components/tripInfo/style/NetListTable.styles.ts +++ b/components/tripInfo/style/NetListTable.styles.ts @@ -48,11 +48,12 @@ export default StyleSheet.create({ color: "#111", textAlign: "center", }, - left: { + sttCell: { + flex: 0.3, + fontSize: 15, + color: "#111", textAlign: "left", - }, - right: { - textAlign: "right", + paddingLeft: 10, }, headerText: { fontWeight: "600", @@ -73,8 +74,4 @@ export default StyleSheet.create({ fontSize: 15, color: "#111", }, - actions: { - flexDirection: "row", - justifyContent: "flex-end", - }, });