From b9cd637b33e95874e12771e6560d154dbbcc70b6 Mon Sep 17 00:00:00 2001 From: MinhNN Date: Thu, 6 Nov 2025 23:59:56 +0700 Subject: [PATCH] Update from MinhNN --- components/tripInfo/CrewListTable.tsx | 8 +------- components/tripInfo/FishingToolsList.tsx | 8 +------- components/tripInfo/TripCostTable.tsx | 8 +------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/components/tripInfo/CrewListTable.tsx b/components/tripInfo/CrewListTable.tsx index c6dd1f2..3a33202 100644 --- a/components/tripInfo/CrewListTable.tsx +++ b/components/tripInfo/CrewListTable.tsx @@ -1,6 +1,6 @@ import { IconSymbol } from "@/components/ui/icon-symbol"; import { useTrip } from "@/state/use-trip"; -import React, { useEffect, useRef, useState } from "react"; +import React, { useRef, useState } from "react"; import { Animated, Text, TouchableOpacity, View } from "react-native"; import CrewDetailModal from "./modal/CrewDetailModal"; import styles from "./style/CrewListTable.styles"; @@ -20,12 +20,6 @@ const CrewListTable: React.FC = () => { const tongThanhVien = data.length; - // Reset animated height khi dữ liệu thay đổi - useEffect(() => { - // setContentHeight(0); // Reset để tính lại chiều cao - setCollapsed(true); // Reset về trạng thái gập lại - }, [data]); - const handleToggle = () => { const toValue = collapsed ? contentHeight : 0; Animated.timing(animatedHeight, { diff --git a/components/tripInfo/FishingToolsList.tsx b/components/tripInfo/FishingToolsList.tsx index 8c14e3a..afc4d21 100644 --- a/components/tripInfo/FishingToolsList.tsx +++ b/components/tripInfo/FishingToolsList.tsx @@ -1,6 +1,6 @@ import { IconSymbol } from "@/components/ui/icon-symbol"; import { useTrip } from "@/state/use-trip"; -import React, { useEffect, useRef, useState } from "react"; +import React, { useRef, useState } from "react"; import { Animated, Text, TouchableOpacity, View } from "react-native"; import styles from "./style/FishingToolsTable.styles"; @@ -13,12 +13,6 @@ const FishingToolsTable: React.FC = () => { const data: Model.FishingGear[] = trip?.fishing_gears ?? []; const tongSoLuong = data.reduce((sum, item) => sum + Number(item.number), 0); - // Reset animated height khi dữ liệu thay đổi - useEffect(() => { - // setContentHeight(0); // Reset để tính lại chiều cao - setCollapsed(true); // Reset về trạng thái gập lại - }, [data]); - const handleToggle = () => { const toValue = collapsed ? contentHeight : 0; Animated.timing(animatedHeight, { diff --git a/components/tripInfo/TripCostTable.tsx b/components/tripInfo/TripCostTable.tsx index 432b83a..c6c6c71 100644 --- a/components/tripInfo/TripCostTable.tsx +++ b/components/tripInfo/TripCostTable.tsx @@ -1,6 +1,6 @@ import { IconSymbol } from "@/components/ui/icon-symbol"; import { useTrip } from "@/state/use-trip"; -import React, { useEffect, useRef, useState } from "react"; +import React, { useRef, useState } from "react"; import { Animated, Text, TouchableOpacity, View } from "react-native"; import TripCostDetailModal from "./modal/TripCostDetailModal"; import styles from "./style/TripCostTable.styles"; @@ -20,12 +20,6 @@ const TripCostTable: React.FC = () => { const data: Model.TripCost[] = trip?.trip_cost ?? []; const tongCong = data.reduce((sum, item) => sum + item.total_cost, 0); - // Reset animated height khi dữ liệu thay đổi - useEffect(() => { - // setContentHeight(0); // Reset để tính lại chiều cao - setCollapsed(true); // Reset về trạng thái gập lại - }, [data]); - const handleToggle = () => { const toValue = collapsed ? contentHeight : 0; Animated.timing(animatedHeight, {