Update from MinhNN
This commit is contained in:
@@ -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, {
|
||||
|
||||
@@ -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, {
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user