update style CreateOrUpdateHaulModal
This commit is contained in:
@@ -160,13 +160,6 @@ const NetListTable: React.FC = () => {
|
|||||||
setModalVisible(false);
|
setModalVisible(false);
|
||||||
}}
|
}}
|
||||||
netData={selectedNet}
|
netData={selectedNet}
|
||||||
stt={
|
|
||||||
selectedNet
|
|
||||||
? data.findIndex(
|
|
||||||
(item) => item.fishing_log_id === selectedNet.fishing_log_id
|
|
||||||
) + 1
|
|
||||||
: undefined
|
|
||||||
}
|
|
||||||
/> */}
|
/> */}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,11 +1,20 @@
|
|||||||
import Select from "@/components/Select";
|
import Select from "@/components/Select";
|
||||||
|
import { IconSymbol } from "@/components/ui/icon-symbol";
|
||||||
import { useFishes } from "@/state/use-fish";
|
import { useFishes } from "@/state/use-fish";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Controller, useFieldArray, useForm } from "react-hook-form";
|
import { Controller, useFieldArray, useForm } from "react-hook-form";
|
||||||
import { Button, FlatList, Modal, Text, TextInput, View } from "react-native";
|
import {
|
||||||
|
Modal,
|
||||||
|
ScrollView,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from "react-native";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { InfoSection } from "./NetDetailModal/components";
|
import { InfoSection } from "./NetDetailModal/components";
|
||||||
|
import styles from "./style/CreateOrUpdateHaulModal.styles";
|
||||||
|
|
||||||
interface CreateOrUpdateHaulModalProps {
|
interface CreateOrUpdateHaulModalProps {
|
||||||
isVisible: boolean;
|
isVisible: boolean;
|
||||||
@@ -52,9 +61,13 @@ const CreateOrUpdateHaulModal: React.FC<CreateOrUpdateHaulModalProps> = ({
|
|||||||
isVisible,
|
isVisible,
|
||||||
onClose,
|
onClose,
|
||||||
fishingLog,
|
fishingLog,
|
||||||
fishingLogIndex
|
fishingLogIndex,
|
||||||
}) => {
|
}) => {
|
||||||
const [isCreateMode, setIsCreateMode] = React.useState(!fishingLog?.info);
|
const [isCreateMode, setIsCreateMode] = React.useState(!fishingLog?.info);
|
||||||
|
const [isEditing, setIsEditing] = React.useState(false);
|
||||||
|
const [expandedFishIndices, setExpandedFishIndices] = React.useState<
|
||||||
|
number[]
|
||||||
|
>([]);
|
||||||
const { control, handleSubmit, formState, watch, reset } =
|
const { control, handleSubmit, formState, watch, reset } =
|
||||||
useForm<FormValues>({
|
useForm<FormValues>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
@@ -74,6 +87,12 @@ const CreateOrUpdateHaulModal: React.FC<CreateOrUpdateHaulModalProps> = ({
|
|||||||
keyName: "_id", // tránh đụng key
|
keyName: "_id", // tránh đụng key
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const handleToggleExpanded = (index: number) => {
|
||||||
|
setExpandedFishIndices((prev) =>
|
||||||
|
prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const onSubmit = (values: FormValues) => {
|
const onSubmit = (values: FormValues) => {
|
||||||
// Map form values to the FishingLogInfo-like shape the user requested
|
// Map form values to the FishingLogInfo-like shape the user requested
|
||||||
const mapped = values.fish.map((f) => {
|
const mapped = values.fish.map((f) => {
|
||||||
@@ -102,6 +121,8 @@ const CreateOrUpdateHaulModal: React.FC<CreateOrUpdateHaulModalProps> = ({
|
|||||||
// when modal closed, clear form to default
|
// when modal closed, clear form to default
|
||||||
reset({ fish: [defaultItem()] });
|
reset({ fish: [defaultItem()] });
|
||||||
setIsCreateMode(true);
|
setIsCreateMode(true);
|
||||||
|
setIsEditing(false);
|
||||||
|
setExpandedFishIndices([]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,6 +131,8 @@ const CreateOrUpdateHaulModal: React.FC<CreateOrUpdateHaulModalProps> = ({
|
|||||||
// explicit null -> start with a single default item
|
// explicit null -> start with a single default item
|
||||||
reset({ fish: [defaultItem()] });
|
reset({ fish: [defaultItem()] });
|
||||||
setIsCreateMode(true);
|
setIsCreateMode(true);
|
||||||
|
setIsEditing(true); // allow editing for new haul
|
||||||
|
setExpandedFishIndices([0]); // expand first item
|
||||||
} else if (Array.isArray(fishingLog?.info) && fishingLog?.info.length > 0) {
|
} else if (Array.isArray(fishingLog?.info) && fishingLog?.info.length > 0) {
|
||||||
// map FishingLogInfo -> form rows
|
// map FishingLogInfo -> form rows
|
||||||
const mapped = fishingLog.info.map((h) => ({
|
const mapped = fishingLog.info.map((h) => ({
|
||||||
@@ -120,132 +143,212 @@ const CreateOrUpdateHaulModal: React.FC<CreateOrUpdateHaulModalProps> = ({
|
|||||||
}));
|
}));
|
||||||
reset({ fish: mapped as any });
|
reset({ fish: mapped as any });
|
||||||
setIsCreateMode(false);
|
setIsCreateMode(false);
|
||||||
|
setIsEditing(false); // view mode by default
|
||||||
|
setExpandedFishIndices([]); // all collapsed
|
||||||
} else {
|
} else {
|
||||||
// undefined or empty array -> default
|
// undefined or empty array -> default
|
||||||
reset({ fish: [defaultItem()] });
|
reset({ fish: [defaultItem()] });
|
||||||
setIsCreateMode(true);
|
setIsCreateMode(true);
|
||||||
|
setIsEditing(true); // allow editing for new haul
|
||||||
|
setExpandedFishIndices([0]); // expand first item
|
||||||
}
|
}
|
||||||
}, [isVisible, fishingLog?.info, reset]);
|
}, [isVisible, fishingLog?.info, reset]);
|
||||||
const renderRow = ({ item, index }: { item: any; index: number }) => {
|
const renderRow = (item: any, index: number) => {
|
||||||
|
const isExpanded = expandedFishIndices.includes(index);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View key={item._id} style={styles.fishCard}>
|
||||||
style={{
|
{/* Delete + Chevron buttons - top right corner */}
|
||||||
marginBottom: 12,
|
<View
|
||||||
padding: 12,
|
style={{
|
||||||
borderWidth: 1,
|
position: "absolute",
|
||||||
borderRadius: 8,
|
top: 0,
|
||||||
}}
|
right: 0,
|
||||||
>
|
zIndex: 9999,
|
||||||
<Text style={{ fontWeight: "600", marginBottom: 8 }}>
|
flexDirection: "row",
|
||||||
Loài cá #{index + 1}
|
alignItems: "center",
|
||||||
</Text>
|
padding: 8,
|
||||||
|
gap: 8,
|
||||||
{/* Species dropdown */}
|
}}
|
||||||
<Controller
|
pointerEvents="box-none"
|
||||||
control={control}
|
>
|
||||||
name={`fish.${index}.id`}
|
{isEditing && (
|
||||||
render={({ field: { value, onChange } }) => (
|
<TouchableOpacity
|
||||||
<View style={{ marginBottom: 8 }}>
|
onPress={() => remove(index)}
|
||||||
<Text style={{ marginBottom: 4 }}>Tên cá</Text>
|
style={{
|
||||||
<Select
|
backgroundColor: "#FF3B30",
|
||||||
options={fishSpecies!.map((fish) => ({
|
borderRadius: 8,
|
||||||
label: fish.name,
|
width: 40,
|
||||||
value: fish.id,
|
height: 40,
|
||||||
}))}
|
justifyContent: "center",
|
||||||
value={value}
|
alignItems: "center",
|
||||||
onChange={onChange}
|
shadowColor: "#000",
|
||||||
placeholder="Chọn loài cá"
|
shadowOpacity: 0.08,
|
||||||
/>
|
shadowRadius: 2,
|
||||||
{errors.fish?.[index]?.id && (
|
shadowOffset: { width: 0, height: 1 },
|
||||||
<Text style={{ color: "red" }}>
|
elevation: 2,
|
||||||
{errors.fish[index]?.id?.message as string}
|
}}
|
||||||
</Text>
|
hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }}
|
||||||
)}
|
activeOpacity={0.7}
|
||||||
</View>
|
>
|
||||||
|
<IconSymbol name="trash" size={24} color="#fff" />
|
||||||
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
/>
|
<TouchableOpacity
|
||||||
|
onPress={() => handleToggleExpanded(index)}
|
||||||
{/* Quantity */}
|
style={{
|
||||||
<Controller
|
backgroundColor: "#007AFF",
|
||||||
control={control}
|
borderRadius: 8,
|
||||||
name={`fish.${index}.quantity`}
|
width: 40,
|
||||||
render={({ field: { value, onChange, onBlur } }) => (
|
height: 40,
|
||||||
<View style={{ marginBottom: 8 }}>
|
justifyContent: "center",
|
||||||
<Text style={{ marginBottom: 4 }}>Số lượng</Text>
|
alignItems: "center",
|
||||||
<TextInput
|
shadowColor: "#000",
|
||||||
keyboardType="numeric"
|
shadowOpacity: 0.08,
|
||||||
value={String(value ?? "")}
|
shadowRadius: 2,
|
||||||
onBlur={onBlur}
|
shadowOffset: { width: 0, height: 1 },
|
||||||
onChangeText={(t) =>
|
elevation: 2,
|
||||||
onChange(Number(t.replace(/,/g, ".")) || 0)
|
}}
|
||||||
}
|
hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }}
|
||||||
style={{ padding: 10, borderWidth: 1, borderRadius: 6 }}
|
activeOpacity={0.7}
|
||||||
/>
|
>
|
||||||
{errors.fish?.[index]?.quantity && (
|
<IconSymbol
|
||||||
<Text style={{ color: "red" }}>
|
name={isExpanded ? "chevron.up" : "chevron.down"}
|
||||||
{errors.fish[index]?.quantity?.message as string}
|
size={24}
|
||||||
</Text>
|
color="#fff"
|
||||||
)}
|
/>
|
||||||
</View>
|
</TouchableOpacity>
|
||||||
)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Unit dropdown */}
|
|
||||||
<Controller
|
|
||||||
control={control}
|
|
||||||
name={`fish.${index}.unit`}
|
|
||||||
render={({ field: { value, onChange } }) => (
|
|
||||||
<View style={{ marginBottom: 8 }}>
|
|
||||||
<Text style={{ marginBottom: 4 }}>Đơn vị</Text>
|
|
||||||
<Select
|
|
||||||
options={UNITS_OPTIONS.map((unit) => ({
|
|
||||||
label: unit.label,
|
|
||||||
value: unit.value,
|
|
||||||
}))}
|
|
||||||
value={value}
|
|
||||||
onChange={onChange}
|
|
||||||
placeholder="Chọn đơn vị"
|
|
||||||
/>
|
|
||||||
{errors.fish?.[index]?.unit && (
|
|
||||||
<Text style={{ color: "red" }}>
|
|
||||||
{errors.fish[index]?.unit?.message as string}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Size (optional) */}
|
|
||||||
<Controller
|
|
||||||
control={control}
|
|
||||||
name={`fish.${index}.size`}
|
|
||||||
render={({ field: { value, onChange, onBlur } }) => (
|
|
||||||
<View style={{ marginBottom: 8 }}>
|
|
||||||
<Text style={{ marginBottom: 4 }}>
|
|
||||||
Kích thước (cm) — tùy chọn
|
|
||||||
</Text>
|
|
||||||
<TextInput
|
|
||||||
keyboardType="numeric"
|
|
||||||
value={value ? String(value) : ""}
|
|
||||||
onBlur={onBlur}
|
|
||||||
onChangeText={(t) =>
|
|
||||||
onChange(t ? Number(t.replace(/,/g, ".")) : undefined)
|
|
||||||
}
|
|
||||||
style={{ padding: 10, borderWidth: 1, borderRadius: 6 }}
|
|
||||||
/>
|
|
||||||
{errors.fish?.[index]?.size && (
|
|
||||||
<Text style={{ color: "red" }}>
|
|
||||||
{errors.fish[index]?.size?.message as string}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* Remove row */}
|
|
||||||
<View style={{ flexDirection: "row", justifyContent: "flex-end" }}>
|
|
||||||
<Button title="Xóa loài này" onPress={() => remove(index)} />
|
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
{/* Header - visible when collapsed */}
|
||||||
|
{!isExpanded && (
|
||||||
|
<View style={{ paddingRight: 100 }}>
|
||||||
|
{(() => {
|
||||||
|
const fishId = watch(`fish.${index}.id`);
|
||||||
|
const fishName = fishSpecies?.find((f) => f.id === fishId)?.name;
|
||||||
|
const quantity = watch(`fish.${index}.quantity`);
|
||||||
|
const unit = watch(`fish.${index}.unit`);
|
||||||
|
|
||||||
|
return fishName ? (
|
||||||
|
<View style={styles.fishCardHeaderContent}>
|
||||||
|
<Text style={styles.fishCardTitle}>{fishName}:</Text>
|
||||||
|
<Text style={styles.fishCardSubtitle}>
|
||||||
|
{quantity} {unit}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
) : null;
|
||||||
|
})()}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Form - visible when expanded */}
|
||||||
|
{isExpanded && (
|
||||||
|
<View style={{ paddingRight: 100 }}>
|
||||||
|
{/* Species dropdown */}
|
||||||
|
<Controller
|
||||||
|
control={control}
|
||||||
|
name={`fish.${index}.id`}
|
||||||
|
render={({ field: { value, onChange } }) => (
|
||||||
|
<View style={styles.fieldGroup}>
|
||||||
|
<Text style={styles.label}>Tên cá</Text>
|
||||||
|
<Select
|
||||||
|
options={fishSpecies!.map((fish) => ({
|
||||||
|
label: fish.name,
|
||||||
|
value: fish.id,
|
||||||
|
}))}
|
||||||
|
value={value}
|
||||||
|
onChange={onChange}
|
||||||
|
placeholder="Chọn loài cá"
|
||||||
|
disabled={!isEditing}
|
||||||
|
/>
|
||||||
|
{errors.fish?.[index]?.id && (
|
||||||
|
<Text style={styles.errorText}>
|
||||||
|
{errors.fish[index]?.id?.message as string}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Quantity */}
|
||||||
|
<Controller
|
||||||
|
control={control}
|
||||||
|
name={`fish.${index}.quantity`}
|
||||||
|
render={({ field: { value, onChange, onBlur } }) => (
|
||||||
|
<View style={styles.fieldGroup}>
|
||||||
|
<Text style={styles.label}>Số lượng</Text>
|
||||||
|
<TextInput
|
||||||
|
keyboardType="numeric"
|
||||||
|
value={String(value ?? "")}
|
||||||
|
onBlur={onBlur}
|
||||||
|
onChangeText={(t) =>
|
||||||
|
onChange(Number(t.replace(/,/g, ".")) || 0)
|
||||||
|
}
|
||||||
|
style={[styles.input, !isEditing && styles.inputDisabled]}
|
||||||
|
editable={isEditing}
|
||||||
|
/>
|
||||||
|
{errors.fish?.[index]?.quantity && (
|
||||||
|
<Text style={styles.errorText}>
|
||||||
|
{errors.fish[index]?.quantity?.message as string}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Unit dropdown */}
|
||||||
|
<Controller
|
||||||
|
control={control}
|
||||||
|
name={`fish.${index}.unit`}
|
||||||
|
render={({ field: { value, onChange } }) => (
|
||||||
|
<View style={styles.fieldGroup}>
|
||||||
|
<Text style={styles.label}>Đơn vị</Text>
|
||||||
|
<Select
|
||||||
|
options={UNITS_OPTIONS.map((unit) => ({
|
||||||
|
label: unit.label,
|
||||||
|
value: unit.value,
|
||||||
|
}))}
|
||||||
|
value={value}
|
||||||
|
onChange={onChange}
|
||||||
|
placeholder="Chọn đơn vị"
|
||||||
|
disabled={!isEditing}
|
||||||
|
/>
|
||||||
|
{errors.fish?.[index]?.unit && (
|
||||||
|
<Text style={styles.errorText}>
|
||||||
|
{errors.fish[index]?.unit?.message as string}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Size (optional) */}
|
||||||
|
<Controller
|
||||||
|
control={control}
|
||||||
|
name={`fish.${index}.size`}
|
||||||
|
render={({ field: { value, onChange, onBlur } }) => (
|
||||||
|
<View style={styles.fieldGroup}>
|
||||||
|
<Text style={styles.label}>Kích thước (cm) — tùy chọn</Text>
|
||||||
|
<TextInput
|
||||||
|
keyboardType="numeric"
|
||||||
|
value={value ? String(value) : ""}
|
||||||
|
onBlur={onBlur}
|
||||||
|
onChangeText={(t) =>
|
||||||
|
onChange(t ? Number(t.replace(/,/g, ".")) : undefined)
|
||||||
|
}
|
||||||
|
style={[styles.input, !isEditing && styles.inputDisabled]}
|
||||||
|
editable={isEditing}
|
||||||
|
/>
|
||||||
|
{errors.fish?.[index]?.size && (
|
||||||
|
<Text style={styles.errorText}>
|
||||||
|
{errors.fish[index]?.size?.message as string}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -257,30 +360,74 @@ const CreateOrUpdateHaulModal: React.FC<CreateOrUpdateHaulModalProps> = ({
|
|||||||
presentationStyle="pageSheet"
|
presentationStyle="pageSheet"
|
||||||
onRequestClose={onClose}
|
onRequestClose={onClose}
|
||||||
>
|
>
|
||||||
<Text>{isCreateMode ? "Create Haul" : "Update Haul"}</Text>
|
<View style={styles.container}>
|
||||||
<InfoSection fishingLog={fishingLog!} stt={fishingLogIndex} />
|
{/* Header */}
|
||||||
<FlatList
|
<View style={styles.header}>
|
||||||
data={fields}
|
<Text style={styles.title}>
|
||||||
keyExtractor={(it) => it._id}
|
{isCreateMode ? "Thêm mẻ cá" : "Chỉnh sửa mẻ cá"}
|
||||||
renderItem={renderRow}
|
</Text>
|
||||||
ListFooterComponent={
|
<View style={styles.headerButtons}>
|
||||||
<View style={{ marginTop: 8 }}>
|
{isEditing ? (
|
||||||
<Button
|
<>
|
||||||
title="Thêm loài cá"
|
<TouchableOpacity
|
||||||
onPress={() => append(defaultItem())}
|
onPress={() => {
|
||||||
/>
|
setIsEditing(false);
|
||||||
|
reset(); // reset to previous values
|
||||||
|
}}
|
||||||
|
style={[styles.saveButton, { backgroundColor: "#6c757d" }]}
|
||||||
|
>
|
||||||
|
<Text style={styles.saveButtonText}>Hủy</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={handleSubmit(onSubmit)}
|
||||||
|
style={styles.saveButton}
|
||||||
|
>
|
||||||
|
<Text style={styles.saveButtonText}>Lưu</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
!isCreateMode && (
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() => setIsEditing(true)}
|
||||||
|
style={[styles.saveButton, { backgroundColor: "#17a2b8" }]}
|
||||||
|
>
|
||||||
|
<Text style={styles.saveButtonText}>Sửa</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
<TouchableOpacity onPress={onClose} style={styles.closeButton}>
|
||||||
|
<View style={styles.closeIconButton}>
|
||||||
|
<IconSymbol name="xmark" size={24} color="#fff" />
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
}
|
</View>
|
||||||
/>
|
|
||||||
|
|
||||||
{errors.fish && (
|
{/* Content */}
|
||||||
<Text style={{ color: "red", marginTop: 8 }}>
|
<ScrollView style={styles.content}>
|
||||||
{(errors.fish as any)?.message}
|
{/* Info Section */}
|
||||||
</Text>
|
<InfoSection fishingLog={fishingLog!} stt={fishingLogIndex} />
|
||||||
)}
|
|
||||||
|
|
||||||
<View style={{ marginTop: 16 }}>
|
{/* Fish List */}
|
||||||
<Button title="Lưu thu hoạch" onPress={handleSubmit(onSubmit)} />
|
{fields.map((item, index) => renderRow(item, index))}
|
||||||
|
|
||||||
|
{/* Add Button - only show when editing */}
|
||||||
|
{isEditing && (
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() => append(defaultItem())}
|
||||||
|
style={styles.addButton}
|
||||||
|
>
|
||||||
|
<Text style={styles.addButtonText}>+ Thêm loài cá</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Error Message */}
|
||||||
|
{errors.fish && (
|
||||||
|
<Text style={styles.errorText}>
|
||||||
|
{(errors.fish as any)?.message}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,176 @@
|
|||||||
|
import { StyleSheet } from "react-native";
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: "#f5f5f5",
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center",
|
||||||
|
paddingHorizontal: 20,
|
||||||
|
paddingTop: 30,
|
||||||
|
paddingBottom: 16,
|
||||||
|
backgroundColor: "#fff",
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
borderBottomColor: "#eee",
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
fontSize: 22,
|
||||||
|
fontWeight: "700",
|
||||||
|
color: "#000",
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
headerButtons: {
|
||||||
|
flexDirection: "row",
|
||||||
|
gap: 12,
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
closeButton: {
|
||||||
|
padding: 4,
|
||||||
|
},
|
||||||
|
closeIconButton: {
|
||||||
|
backgroundColor: "#FF3B30",
|
||||||
|
borderRadius: 10,
|
||||||
|
padding: 10,
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
saveButton: {
|
||||||
|
backgroundColor: "#007bff",
|
||||||
|
borderRadius: 8,
|
||||||
|
paddingHorizontal: 20,
|
||||||
|
paddingVertical: 10,
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
saveButtonText: {
|
||||||
|
color: "#fff",
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: "600",
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
flex: 1,
|
||||||
|
padding: 16,
|
||||||
|
marginBottom: 15,
|
||||||
|
},
|
||||||
|
fishCard: {
|
||||||
|
backgroundColor: "#fff",
|
||||||
|
borderRadius: 12,
|
||||||
|
padding: 16,
|
||||||
|
marginBottom: 16,
|
||||||
|
shadowColor: "#000",
|
||||||
|
shadowOpacity: 0.05,
|
||||||
|
shadowRadius: 4,
|
||||||
|
shadowOffset: { width: 0, height: 2 },
|
||||||
|
elevation: 2,
|
||||||
|
},
|
||||||
|
|
||||||
|
fishCardHeaderContent: {
|
||||||
|
flexDirection: "row",
|
||||||
|
alignItems: "center",
|
||||||
|
gap: 8,
|
||||||
|
},
|
||||||
|
fishCardTitle: {
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: "700",
|
||||||
|
color: "#000",
|
||||||
|
},
|
||||||
|
fishCardSubtitle: {
|
||||||
|
fontSize: 14,
|
||||||
|
color: "#666",
|
||||||
|
fontWeight: "500",
|
||||||
|
},
|
||||||
|
fieldGroup: {
|
||||||
|
marginBottom: 14,
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: "600",
|
||||||
|
color: "#333",
|
||||||
|
marginBottom: 6,
|
||||||
|
},
|
||||||
|
input: {
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: "#ddd",
|
||||||
|
borderRadius: 8,
|
||||||
|
paddingHorizontal: 12,
|
||||||
|
paddingVertical: 10,
|
||||||
|
fontSize: 16,
|
||||||
|
backgroundColor: "#fff",
|
||||||
|
color: "#000",
|
||||||
|
},
|
||||||
|
inputDisabled: {
|
||||||
|
backgroundColor: "#f5f5f5",
|
||||||
|
color: "#999",
|
||||||
|
borderColor: "#eee",
|
||||||
|
},
|
||||||
|
errorText: {
|
||||||
|
color: "#dc3545",
|
||||||
|
fontSize: 12,
|
||||||
|
marginTop: 4,
|
||||||
|
fontWeight: "500",
|
||||||
|
},
|
||||||
|
buttonRow: {
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "flex-end",
|
||||||
|
gap: 8,
|
||||||
|
marginTop: 12,
|
||||||
|
},
|
||||||
|
removeButton: {
|
||||||
|
backgroundColor: "#dc3545",
|
||||||
|
borderRadius: 8,
|
||||||
|
paddingHorizontal: 16,
|
||||||
|
paddingVertical: 8,
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
removeButtonText: {
|
||||||
|
color: "#fff",
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: "600",
|
||||||
|
},
|
||||||
|
addButton: {
|
||||||
|
backgroundColor: "#28a745",
|
||||||
|
borderRadius: 8,
|
||||||
|
paddingHorizontal: 20,
|
||||||
|
paddingVertical: 12,
|
||||||
|
marginTop: 16,
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
alignSelf: "flex-start",
|
||||||
|
},
|
||||||
|
addButtonText: {
|
||||||
|
color: "#fff",
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: "600",
|
||||||
|
},
|
||||||
|
footerSection: {
|
||||||
|
paddingHorizontal: 16,
|
||||||
|
paddingVertical: 16,
|
||||||
|
backgroundColor: "#fff",
|
||||||
|
borderTopWidth: 1,
|
||||||
|
borderTopColor: "#eee",
|
||||||
|
},
|
||||||
|
saveButtonLarge: {
|
||||||
|
backgroundColor: "#007bff",
|
||||||
|
borderRadius: 8,
|
||||||
|
paddingVertical: 14,
|
||||||
|
justifyContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
saveButtonLargeText: {
|
||||||
|
color: "#fff",
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: "700",
|
||||||
|
},
|
||||||
|
emptyStateText: {
|
||||||
|
textAlign: "center",
|
||||||
|
color: "#999",
|
||||||
|
fontSize: 14,
|
||||||
|
marginTop: 20,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default styles;
|
||||||
Reference in New Issue
Block a user