diff --git a/components/tripInfo/modal/CreateOrUpdateHaulModal.tsx b/components/tripInfo/modal/CreateOrUpdateHaulModal.tsx index bab20f3..e867f83 100644 --- a/components/tripInfo/modal/CreateOrUpdateHaulModal.tsx +++ b/components/tripInfo/modal/CreateOrUpdateHaulModal.tsx @@ -20,7 +20,7 @@ import { View, } from "react-native"; import { z } from "zod"; -import { InfoSection } from "./NetDetailModal/components"; +import { InfoSection } from "./components/InfoSection"; import styles from "./style/CreateOrUpdateHaulModal.styles"; interface CreateOrUpdateHaulModalProps { diff --git a/components/tripInfo/modal/NetDetailModal/NetDetailModal.tsx b/components/tripInfo/modal/NetDetailModal/NetDetailModal.tsx deleted file mode 100644 index 911ec6a..0000000 --- a/components/tripInfo/modal/NetDetailModal/NetDetailModal.tsx +++ /dev/null @@ -1,362 +0,0 @@ -import { IconSymbol } from "@/components/ui/icon-symbol"; -import React, { useState } from "react"; -import { - Alert, - Modal, - ScrollView, - Text, - TouchableOpacity, - View, -} from "react-native"; -import styles from "../style/NetDetailModal.styles"; -import { CatchSectionHeader } from "./components/CatchSectionHeader"; -import { FishCardList } from "./components/FishCardList"; -import { NotesSection } from "./components/NotesSection"; - -interface NetDetailModalProps { - visible: boolean; - onClose: () => void; - netData: Model.FishingLog | null; - stt?: number; -} - -// --------------------------- -// 🧵 Component Modal -// --------------------------- -const NetDetailModal: React.FC = ({ - visible, - onClose, - netData, - stt, -}) => { - const [isEditing, setIsEditing] = useState(false); - const [editableCatchList, setEditableCatchList] = useState< - Model.FishingLogInfo[] - >([]); - const [selectedFishIndex, setSelectedFishIndex] = useState( - null - ); - const [selectedUnitIndex, setSelectedUnitIndex] = useState( - null - ); - // const [selectedConditionIndex, setSelectedConditionIndex] = useState< - // number | null - // >(null); - // const [selectedGearIndex, setSelectedGearIndex] = useState( - // null - // ); - const [expandedFishIndices, setExpandedFishIndices] = useState([]); - - // Khởi tạo dữ liệu khi netData thay đổi - React.useEffect(() => { - if (netData?.info) { - setEditableCatchList(netData.info); - } - }, [netData]); - - // Reset state khi modal đóng - React.useEffect(() => { - if (!visible) { - setExpandedFishIndices([]); - setSelectedFishIndex(null); - setSelectedUnitIndex(null); - // setSelectedConditionIndex(null); - // setSelectedGearIndex(null); - setIsEditing(false); - } - }, [visible]); - - // if (!netData) return null; - - const isCompleted = netData?.status === 2; // ví dụ: status=2 là hoàn thành - - // Danh sách tên cá có sẵn - const fishNameOptions = [ - "Cá chim trắng", - "Cá song đỏ", - "Cá hồng", - "Cá nục", - "Cá ngừ đại dương", - "Cá mú trắng", - "Cá hồng phớn", - "Cá hổ Napoleon", - "Cá nược", - "Cá đuối quạt", - ]; - - // Danh sách đơn vị - const unitOptions = ["kg", "con", "tấn"]; - - // Danh sách tình trạng - // const conditionOptions = ["Còn sống", "Chết", "Bị thương"]; - - // Danh sách ngư cụ - // const gearOptions = [ - // "Lưới kéo", - // "Lưới vây", - // "Lưới rê", - // "Lưới cào", - // "Lưới lồng", - // "Câu cần", - // "Câu dây", - // "Chài cá", - // "Lồng bẫy", - // "Đăng", - // ]; - - const handleEdit = () => { - setIsEditing(!isEditing); - }; - - const handleSave = () => { - // Validate từng cá trong danh sách và thu thập tất cả lỗi - const allErrors: { index: number; errors: string[] }[] = []; - - for (let i = 0; i < editableCatchList.length; i++) { - const fish = editableCatchList[i]; - const errors: string[] = []; - - if (!fish.fish_name || fish.fish_name.trim() === "") { - errors.push("- Tên loài cá"); - } - if (!fish.catch_number || fish.catch_number <= 0) { - errors.push("- Số lượng bắt được"); - } - if (!fish.catch_unit || fish.catch_unit.trim() === "") { - errors.push("- Đơn vị"); - } - if (!fish.fish_size || fish.fish_size <= 0) { - errors.push("- Kích thước cá"); - } - // if (!fish.fish_condition || fish.fish_condition.trim() === "") { - // errors.push("- Tình trạng cá"); - // } - // if (!fish.gear_usage || fish.gear_usage.trim() === "") { - // errors.push("- Dụng cụ sử dụng"); - // } - - if (errors.length > 0) { - allErrors.push({ index: i, errors }); - } - } - - // Nếu có lỗi, hiển thị tất cả - if (allErrors.length > 0) { - const errorMessage = allErrors - .map((item) => { - return `Cá số ${item.index + 1}:\n${item.errors.join("\n")}`; - }) - .join("\n\n"); - - Alert.alert( - "Thông tin không đầy đủ", - errorMessage, - [ - { - text: "Tiếp tục chỉnh sửa", - onPress: () => { - // Mở rộng tất cả các card bị lỗi - setExpandedFishIndices((prev) => { - const errorIndices = allErrors.map((item) => item.index); - const newIndices = [...prev]; - errorIndices.forEach((idx) => { - if (!newIndices.includes(idx)) { - newIndices.push(idx); - } - }); - return newIndices; - }); - }, - }, - { - text: "Hủy", - onPress: () => {}, - }, - ], - { cancelable: false } - ); - return; - } - - // Nếu validation pass, lưu dữ liệu - setIsEditing(false); - console.log("Saved catch list:", editableCatchList); - }; - - const handleCancel = () => { - setIsEditing(false); - setEditableCatchList(netData?.info || []); - }; - - const handleToggleExpanded = (index: number) => { - setExpandedFishIndices((prev) => - prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index] - ); - }; - - const updateCatchItem = ( - index: number, - field: keyof Model.FishingLogInfo, - value: string | number - ) => { - setEditableCatchList((prev) => - prev.map((item, i) => { - if (i === index) { - const updatedItem = { ...item }; - if ( - field === "catch_number" || - field === "fish_size" || - field === "fish_rarity" - ) { - updatedItem[field] = Number(value) || 0; - } else { - updatedItem[field] = value as never; - } - return updatedItem; - } - return item; - }) - ); - }; - - const handleAddNewFish = () => { - const newFish: Model.FishingLogInfo = { - fish_species_id: 0, - fish_name: "", - catch_number: 0, - catch_unit: "kg", - fish_size: 0, - fish_rarity: 0, - fish_condition: "", - gear_usage: "", - }; - setEditableCatchList((prev) => [...prev, newFish]); - // Tự động expand card mới - setExpandedFishIndices((prev) => [...prev, editableCatchList.length]); - }; - - const handleDeleteFish = (index: number) => { - Alert.alert( - "Xác nhận xóa", - `Bạn có chắc muốn xóa loài cá này?`, - [ - { - text: "Hủy", - style: "cancel", - }, - { - text: "Xóa", - style: "destructive", - onPress: () => { - setEditableCatchList((prev) => prev.filter((_, i) => i !== index)); - // Cập nhật lại expandedFishIndices sau khi xóa - setExpandedFishIndices((prev) => - prev - .filter((i) => i !== index) - .map((i) => (i > index ? i - 1 : i)) - ); - }, - }, - ], - { cancelable: true } - ); - }; - - // Chỉ tính tổng số lượng cá có đơn vị là 'kg' - const totalCatch = editableCatchList.reduce( - (sum, item) => - item.catch_unit === "kg" ? sum + (item.catch_number ?? 0) : sum, - 0 - ); - - return ( - - - {/* Header */} - - Chi tiết mẻ lưới - - {isEditing ? ( - <> - - Hủy - - - Lưu - - - ) : ( - - - - - - )} - - - - - - - - - {/* Content */} - - {/* Thông tin chung */} - {/* */} - - {/* Danh sách cá bắt được */} - - - {/* Fish cards */} - - - {/* Ghi chú */} - - - - - ); -}; - -export default NetDetailModal; diff --git a/components/tripInfo/modal/NetDetailModal/components/CatchSectionHeader.tsx b/components/tripInfo/modal/NetDetailModal/components/CatchSectionHeader.tsx deleted file mode 100644 index b9de124..0000000 --- a/components/tripInfo/modal/NetDetailModal/components/CatchSectionHeader.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react"; -import { Text, View } from "react-native"; -import styles from "../../style/NetDetailModal.styles"; - -interface CatchSectionHeaderProps { - totalCatch: number; -} - -export const CatchSectionHeader: React.FC = ({ - totalCatch, -}) => { - return ( - - Danh sách cá bắt được - - Tổng: {totalCatch.toLocaleString()} kg - - - ); -}; diff --git a/components/tripInfo/modal/NetDetailModal/components/FishCardForm.tsx b/components/tripInfo/modal/NetDetailModal/components/FishCardForm.tsx deleted file mode 100644 index 4c9b8b3..0000000 --- a/components/tripInfo/modal/NetDetailModal/components/FishCardForm.tsx +++ /dev/null @@ -1,207 +0,0 @@ -import { useFishes } from "@/state/use-fish"; -import React from "react"; -import { Text, TextInput, View } from "react-native"; -import styles from "../../style/NetDetailModal.styles"; -import { FishSelectDropdown } from "./FishSelectDropdown"; - -interface FishCardFormProps { - fish: Model.FishingLogInfo; - index: number; - isEditing: boolean; - fishNameOptions: string[]; // Bỏ gọi API cá - unitOptions: string[]; // Bỏ render ở trong này - // conditionOptions: string[]; - // gearOptions: string[]; - selectedFishIndex: number | null; - selectedUnitIndex: number | null; - // selectedConditionIndex: number | null; - // selectedGearIndex: number | null; - setSelectedFishIndex: (index: number | null) => void; - setSelectedUnitIndex: (index: number | null) => void; - // setSelectedConditionIndex: (index: number | null) => void; - // setSelectedGearIndex: (index: number | null) => void; - onUpdateCatchItem: ( - index: number, - field: keyof Model.FishingLogInfo, - value: string | number - ) => void; -} - -export const FishCardForm: React.FC = ({ - fish, - index, - isEditing, - unitOptions, - // conditionOptions, - // gearOptions, - selectedFishIndex, - selectedUnitIndex, - // selectedConditionIndex, - // selectedGearIndex, - setSelectedFishIndex, - setSelectedUnitIndex, - // setSelectedConditionIndex, - // setSelectedGearIndex, - onUpdateCatchItem, -}) => { - const { fishSpecies } = useFishes(); - - return ( - <> - {/* Tên cá - Select */} - - Tên cá - {isEditing ? ( - - setSelectedFishIndex(selectedFishIndex === index ? null : index) - } - onSelect={(value: Model.FishSpeciesResponse) => { - onUpdateCatchItem(index, "fish_name", value.name); - setSelectedFishIndex(value.id); - console.log("Fish Selected: ", fish); - }} - zIndex={1000 - index} - styleOverride={styles.fishNameDropdown} - /> - ) : ( - {fish.fish_name} - )} - - - {/* Số lượng & Đơn vị */} - - - Số lượng - {isEditing ? ( - - onUpdateCatchItem(index, "catch_number", value) - } - keyboardType="numeric" - placeholder="0" - /> - ) : ( - {fish.catch_number} - )} - - - Đơn vị - {/* {isEditing ? ( - - setSelectedUnitIndex(selectedUnitIndex === index ? null : index) - } - onSelect={(value: string) => { - onUpdateCatchItem(index, "catch_unit", value); - setSelectedUnitIndex(null); - }} - zIndex={900 - index} - /> - ) : ( - {fish.catch_unit} - )} */} - - - - {/* Kích thước & Độ hiếm */} - - - Kích thước (cm) - {isEditing ? ( - - onUpdateCatchItem(index, "fish_size", value) - } - keyboardType="numeric" - placeholder="0" - /> - ) : ( - {fish.fish_size} cm - )} - - - Độ hiếm - {isEditing ? ( - - onUpdateCatchItem(index, "fish_rarity", value) - } - keyboardType="numeric" - placeholder="1-5" - /> - ) : ( - {fish.fish_rarity} - )} - - - - {/* Tình trạng */} - {/* - Tình trạng - {isEditing ? ( - - setSelectedConditionIndex( - selectedConditionIndex === index ? null : index - ) - } - onSelect={(value: string) => { - onUpdateCatchItem(index, "fish_condition", value); - setSelectedConditionIndex(null); - }} - zIndex={800 - index} - styleOverride={styles.optionsStatusFishList} - /> - ) : ( - {fish.fish_condition} - )} - */} - - {/* Ngư cụ sử dụng */} - {/* - Ngư cụ sử dụng - {isEditing ? ( - - setSelectedGearIndex(selectedGearIndex === index ? null : index) - } - onSelect={(value: string) => { - onUpdateCatchItem(index, "gear_usage", value); - setSelectedGearIndex(null); - }} - zIndex={700 - index} - styleOverride={styles.optionsStatusFishList} - /> - ) : ( - {fish.gear_usage || "Không có"} - )} - */} - - ); -}; diff --git a/components/tripInfo/modal/NetDetailModal/components/FishCardHeader.tsx b/components/tripInfo/modal/NetDetailModal/components/FishCardHeader.tsx deleted file mode 100644 index 4391153..0000000 --- a/components/tripInfo/modal/NetDetailModal/components/FishCardHeader.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from "react"; -import { Text, View } from "react-native"; -import styles from "../../style/NetDetailModal.styles"; - -interface FishCardHeaderProps { - fish: Model.FishingLogInfo; -} - -export const FishCardHeader: React.FC = ({ fish }) => { - return ( - - {fish.fish_name}: - - {fish.catch_number} {fish.catch_unit} - - - ); -}; diff --git a/components/tripInfo/modal/NetDetailModal/components/FishCardList.tsx b/components/tripInfo/modal/NetDetailModal/components/FishCardList.tsx deleted file mode 100644 index 1015ffb..0000000 --- a/components/tripInfo/modal/NetDetailModal/components/FishCardList.tsx +++ /dev/null @@ -1,168 +0,0 @@ -import { IconSymbol } from "@/components/ui/icon-symbol"; -import React from "react"; -import { Text, TouchableOpacity, View } from "react-native"; -import styles from "../../style/NetDetailModal.styles"; -import { FishCardForm } from "./FishCardForm"; -import { FishCardHeader } from "./FishCardHeader"; - -interface FishCardListProps { - catchList: Model.FishingLogInfo[]; - isEditing: boolean; - expandedFishIndex: number[]; - selectedFishIndex: number | null; - selectedUnitIndex: number | null; - // selectedConditionIndex: number | null; - // selectedGearIndex: number | null; - fishNameOptions: string[]; - unitOptions: string[]; - // conditionOptions: string[]; - // gearOptions: string[]; - onToggleExpanded: (index: number) => void; - onUpdateCatchItem: ( - index: number, - field: keyof Model.FishingLogInfo, - value: string | number - ) => void; - setSelectedFishIndex: (index: number | null) => void; - setSelectedUnitIndex: (index: number | null) => void; - // setSelectedConditionIndex: (index: number | null) => void; - // setSelectedGearIndex: (index: number | null) => void; - onAddNewFish?: () => void; - onDeleteFish?: (index: number) => void; -} - -export const FishCardList: React.FC = ({ - catchList, - isEditing, - expandedFishIndex, - selectedFishIndex, - selectedUnitIndex, - // selectedConditionIndex, - // selectedGearIndex, - fishNameOptions, - unitOptions, - // conditionOptions, - // gearOptions, - onToggleExpanded, - onUpdateCatchItem, - setSelectedFishIndex, - setSelectedUnitIndex, - // setSelectedConditionIndex, - // setSelectedGearIndex, - onAddNewFish, - onDeleteFish, -}) => { - // Chuyển về logic đơn giản, không animation - const handleToggleCard = (index: number) => { - onToggleExpanded(index); - }; - - return ( - <> - {catchList.map((fish, index) => ( - - {/* Delete + Chevron buttons - always on top, right side, horizontal row */} - - {isEditing && ( - onDeleteFish?.(index)} - style={{ - backgroundColor: "#FF3B30", - borderRadius: 8, - width: 40, - height: 40, - justifyContent: "center", - alignItems: "center", - shadowColor: "#000", - shadowOpacity: 0.08, - shadowRadius: 2, - shadowOffset: { width: 0, height: 1 }, - elevation: 2, - }} - hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }} - activeOpacity={0.7} - > - - - )} - handleToggleCard(index)} - style={{ - backgroundColor: "#007AFF", - borderRadius: 8, - width: 40, - height: 40, - justifyContent: "center", - alignItems: "center", - shadowColor: "#000", - shadowOpacity: 0.08, - shadowRadius: 2, - shadowOffset: { width: 0, height: 1 }, - elevation: 2, - }} - hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }} - activeOpacity={0.7} - > - - - - - {/* Header - Only visible when collapsed */} - {!expandedFishIndex.includes(index) && } - - {/* Form - Only show when expanded */} - {expandedFishIndex.includes(index) && ( - - )} - - ))} - - {/* Nút thêm loài cá mới - hiển thị khi đang chỉnh sửa */} - {isEditing && ( - - - - Thêm loài cá - - - )} - - ); -}; diff --git a/components/tripInfo/modal/NetDetailModal/components/FishSelectDropdown.tsx b/components/tripInfo/modal/NetDetailModal/components/FishSelectDropdown.tsx deleted file mode 100644 index a6eb5e4..0000000 --- a/components/tripInfo/modal/NetDetailModal/components/FishSelectDropdown.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { IconSymbol } from "@/components/ui/icon-symbol"; -import React from "react"; -import { ScrollView, Text, TouchableOpacity, View } from "react-native"; -import styles from "../../style/NetDetailModal.styles"; - -interface FishSelectDropdownProps { - options: Model.FishSpeciesResponse[]; - selectedFishId: number | null; - isOpen: boolean; - onToggle: () => void; - onSelect: (value: Model.FishSpeciesResponse) => void; - zIndex: number; - styleOverride?: any; -} - -export const FishSelectDropdown: React.FC = ({ - options, - selectedFishId, - isOpen, - onToggle, - onSelect, - zIndex, - styleOverride, -}) => { - const dropdownStyle = styleOverride || styles.optionsList; - const findFishNameById = (id: number | null) => { - const fish = options.find((item) => item.id === id); - return fish?.name || "Chọn cá"; - }; - const [selectedFish, setSelectedFish] = - React.useState(null); - return ( - - - - {findFishNameById(selectedFishId)} - - - - {isOpen && ( - - {options.map((option, optIndex) => ( - onSelect(option)} - > - - {findFishNameById(option.id)} - - - ))} - - )} - - ); -}; diff --git a/components/tripInfo/modal/NetDetailModal/components/NotesSection.tsx b/components/tripInfo/modal/NetDetailModal/components/NotesSection.tsx deleted file mode 100644 index 81fa00a..0000000 --- a/components/tripInfo/modal/NetDetailModal/components/NotesSection.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react"; -import { Text, View } from "react-native"; -import styles from "../../style/NetDetailModal.styles"; - -interface NotesSectionProps { - ghiChu?: string; -} - -export const NotesSection: React.FC = ({ ghiChu }) => { - if (!ghiChu) return null; - - return ( - - - Ghi chú - {ghiChu} - - - ); -}; diff --git a/components/tripInfo/modal/NetDetailModal/components/index.ts b/components/tripInfo/modal/NetDetailModal/components/index.ts deleted file mode 100644 index f81f198..0000000 --- a/components/tripInfo/modal/NetDetailModal/components/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { CatchSectionHeader } from "./CatchSectionHeader"; -export { FishCardForm } from "./FishCardForm"; -export { FishCardHeader } from "./FishCardHeader"; -export { FishCardList } from "./FishCardList"; -export { FishSelectDropdown } from "./FishSelectDropdown"; -export { InfoSection } from "./InfoSection"; -export { NotesSection } from "./NotesSection"; diff --git a/components/tripInfo/modal/NetDetailModal/style/NetDetailModal.styles.ts b/components/tripInfo/modal/NetDetailModal/style/NetDetailModal.styles.ts deleted file mode 100644 index 5089336..0000000 --- a/components/tripInfo/modal/NetDetailModal/style/NetDetailModal.styles.ts +++ /dev/null @@ -1,177 +0,0 @@ -import { StyleSheet } from "react-native"; - -export default StyleSheet.create({ - container: { - flex: 1, - backgroundColor: "#fff", - }, - header: { - flexDirection: "row", - justifyContent: "space-between", - alignItems: "center", - paddingHorizontal: 16, - paddingTop: 16, - paddingBottom: 8, - backgroundColor: "#f8f9fa", - borderBottomWidth: 1, - borderBottomColor: "#e9ecef", - }, - title: { - fontSize: 18, - fontWeight: "bold", - color: "#333", - }, - closeButton: { - padding: 8, - }, - closeButtonText: { - fontSize: 16, - color: "#007bff", - }, - content: { - flex: 1, - padding: 16, - }, - fieldGroup: { - marginBottom: 16, - }, - label: { - fontSize: 14, - fontWeight: "600", - color: "#333", - marginBottom: 4, - }, - input: { - borderWidth: 1, - borderColor: "#ccc", - borderRadius: 4, - padding: 8, - fontSize: 16, - backgroundColor: "#fff", - }, - infoValue: { - fontSize: 16, - color: "#555", - paddingVertical: 8, - }, - rowGroup: { - flexDirection: "row", - justifyContent: "space-between", - }, - fishNameDropdown: { - // Custom styles if needed - }, - optionsStatusFishList: { - // Custom styles if needed - }, - optionsList: { - maxHeight: 150, - borderWidth: 1, - borderColor: "#ccc", - borderRadius: 4, - backgroundColor: "#fff", - position: "absolute", - top: 40, - left: 0, - right: 0, - zIndex: 1000, - }, - selectButton: { - borderWidth: 1, - borderColor: "#ccc", - borderRadius: 4, - padding: 8, - backgroundColor: "#fff", - flexDirection: "row", - justifyContent: "space-between", - alignItems: "center", - }, - selectButtonText: { - fontSize: 16, - color: "#333", - }, - optionItem: { - padding: 10, - borderBottomWidth: 1, - borderBottomColor: "#eee", - }, - optionText: { - fontSize: 16, - color: "#333", - }, - card: { - borderWidth: 1, - borderColor: "#ddd", - borderRadius: 8, - padding: 12, - marginBottom: 12, - backgroundColor: "#f9f9f9", - }, - removeButton: { - backgroundColor: "#dc3545", - padding: 8, - borderRadius: 4, - alignSelf: "flex-end", - marginTop: 8, - }, - removeButtonText: { - color: "#fff", - fontSize: 14, - }, - errorText: { - color: "#dc3545", - fontSize: 12, - marginTop: 4, - }, - buttonGroup: { - flexDirection: "row", - justifyContent: "space-around", - marginTop: 16, - }, - editButton: { - backgroundColor: "#007bff", - padding: 10, - borderRadius: 4, - }, - editButtonText: { - color: "#fff", - fontSize: 16, - }, - addButton: { - backgroundColor: "#28a745", - padding: 10, - borderRadius: 4, - }, - addButtonText: { - color: "#fff", - fontSize: 16, - }, - saveButton: { - backgroundColor: "#007bff", - padding: 10, - borderRadius: 4, - }, - saveButtonText: { - color: "#fff", - fontSize: 16, - }, - cancelButton: { - backgroundColor: "#6c757d", - padding: 10, - borderRadius: 4, - }, - cancelButtonText: { - color: "#fff", - fontSize: 16, - }, - addFishButton: { - backgroundColor: "#17a2b8", - padding: 10, - borderRadius: 4, - marginBottom: 16, - }, - addFishButtonText: { - color: "#fff", - fontSize: 16, - }, -}); diff --git a/components/tripInfo/modal/NetDetailModal/components/InfoSection.tsx b/components/tripInfo/modal/components/InfoSection.tsx similarity index 71% rename from components/tripInfo/modal/NetDetailModal/components/InfoSection.tsx rename to components/tripInfo/modal/components/InfoSection.tsx index a64101f..3c86d43 100644 --- a/components/tripInfo/modal/NetDetailModal/components/InfoSection.tsx +++ b/components/tripInfo/modal/components/InfoSection.tsx @@ -1,7 +1,6 @@ import { useI18n } from "@/hooks/use-i18n"; import React from "react"; -import { Text, View } from "react-native"; -import styles from "../../style/NetDetailModal.styles"; +import { StyleSheet, Text, View } from "react-native"; interface InfoSectionProps { fishingLog?: Model.FishingLog; @@ -93,3 +92,54 @@ export const InfoSection: React.FC = ({ ); }; + +const styles = StyleSheet.create({ + infoCard: { + borderWidth: 1, + borderColor: "#ddd", + borderRadius: 8, + padding: 12, + marginBottom: 12, + backgroundColor: "#f9f9f9", + }, + infoRow: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + marginBottom: 8, + }, + infoLabel: { + fontSize: 14, + fontWeight: "600", + color: "#333", + }, + infoValue: { + fontSize: 16, + color: "#555", + paddingVertical: 8, + }, + statusBadge: { + paddingVertical: 4, + paddingHorizontal: 12, + borderRadius: 12, + alignItems: "center", + justifyContent: "center", + }, + statusBadgeCompleted: { + backgroundColor: "#34C759", + }, + statusBadgeInProgress: { + backgroundColor: "#FF9500", + }, + statusBadgeText: { + fontSize: 14, + fontWeight: "600", + color: "#fff", + }, + statusBadgeTextCompleted: { + color: "#fff", + }, + statusBadgeTextInProgress: { + color: "#fff", + }, +});