cập nhật themes cho tab
This commit is contained in:
@@ -16,9 +16,11 @@ import { useThings } from "@/state/use-thing";
|
|||||||
import { useTripsList } from "@/state/use-tripslist";
|
import { useTripsList } from "@/state/use-tripslist";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { useI18n } from "@/hooks/use-i18n";
|
import { useI18n } from "@/hooks/use-i18n";
|
||||||
|
import { useThemeContext } from "@/hooks/use-theme-context";
|
||||||
|
|
||||||
export default function diary() {
|
export default function diary() {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { colors } = useThemeContext();
|
||||||
const [showFilterModal, setShowFilterModal] = useState(false);
|
const [showFilterModal, setShowFilterModal] = useState(false);
|
||||||
const [filters, setFilters] = useState<FilterValues>({
|
const [filters, setFilters] = useState<FilterValues>({
|
||||||
status: null,
|
status: null,
|
||||||
@@ -136,11 +138,30 @@ export default function diary() {
|
|||||||
// TODO: Show confirmation dialog and delete trip
|
// TODO: Show confirmation dialog and delete trip
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Dynamic styles based on theme
|
||||||
|
const themedStyles = {
|
||||||
|
safeArea: {
|
||||||
|
backgroundColor: colors.background,
|
||||||
|
},
|
||||||
|
titleText: {
|
||||||
|
color: colors.text,
|
||||||
|
},
|
||||||
|
countText: {
|
||||||
|
color: colors.textSecondary,
|
||||||
|
},
|
||||||
|
addButton: {
|
||||||
|
backgroundColor: colors.primary,
|
||||||
|
},
|
||||||
|
emptyText: {
|
||||||
|
color: colors.textSecondary,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.safeArea} edges={["top"]}>
|
<SafeAreaView style={[styles.safeArea, themedStyles.safeArea]} edges={["top"]}>
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<Text style={styles.titleText}>{t("diary.title")}</Text>
|
<Text style={[styles.titleText, themedStyles.titleText]}>{t("diary.title")}</Text>
|
||||||
|
|
||||||
{/* Filter & Add Button Row */}
|
{/* Filter & Add Button Row */}
|
||||||
<View style={styles.actionRow}>
|
<View style={styles.actionRow}>
|
||||||
@@ -154,7 +175,7 @@ export default function diary() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.addButton}
|
style={[styles.addButton, themedStyles.addButton]}
|
||||||
onPress={() => console.log("Add trip")}
|
onPress={() => console.log("Add trip")}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
@@ -164,7 +185,7 @@ export default function diary() {
|
|||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* Trip Count */}
|
{/* Trip Count */}
|
||||||
<Text style={styles.countText}>
|
<Text style={[styles.countText, themedStyles.countText]}>
|
||||||
{t("diary.tripListCount", { count: tripsList?.total || 0 })}
|
{t("diary.tripListCount", { count: tripsList?.total || 0 })}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
@@ -189,7 +210,7 @@ export default function diary() {
|
|||||||
|
|
||||||
{(!tripsList || !tripsList.trips || tripsList.trips.length === 0) && (
|
{(!tripsList || !tripsList.trips || tripsList.trips.length === 0) && (
|
||||||
<View style={styles.emptyState}>
|
<View style={styles.emptyState}>
|
||||||
<Text style={styles.emptyText}>
|
<Text style={[styles.emptyText, themedStyles.emptyText]}>
|
||||||
{t("diary.noTripsFound")}
|
{t("diary.noTripsFound")}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -210,7 +231,6 @@ export default function diary() {
|
|||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
safeArea: {
|
safeArea: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: "#F9FAFB",
|
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@@ -221,7 +241,6 @@ const styles = StyleSheet.create({
|
|||||||
fontWeight: "700",
|
fontWeight: "700",
|
||||||
lineHeight: 36,
|
lineHeight: 36,
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
color: "#111827",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
@@ -245,7 +264,6 @@ const styles = StyleSheet.create({
|
|||||||
countText: {
|
countText: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
color: "#374151",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
@@ -256,7 +274,6 @@ const styles = StyleSheet.create({
|
|||||||
addButton: {
|
addButton: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
backgroundColor: "#3B82F6",
|
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
paddingVertical: 8,
|
paddingVertical: 8,
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
@@ -285,7 +302,6 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
emptyText: {
|
emptyText: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: "#9CA3AF",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import DateTimePicker from "@react-native-community/datetimepicker";
|
import DateTimePicker from "@react-native-community/datetimepicker";
|
||||||
import { useI18n } from "@/hooks/use-i18n";
|
import { useI18n } from "@/hooks/use-i18n";
|
||||||
|
import { useThemeContext } from "@/hooks/use-theme-context";
|
||||||
|
|
||||||
interface DateRangePickerProps {
|
interface DateRangePickerProps {
|
||||||
startDate: Date | null;
|
startDate: Date | null;
|
||||||
@@ -25,6 +26,7 @@ export default function DateRangePicker({
|
|||||||
onEndDateChange,
|
onEndDateChange,
|
||||||
}: DateRangePickerProps) {
|
}: DateRangePickerProps) {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { colors, colorScheme } = useThemeContext();
|
||||||
const [showStartPicker, setShowStartPicker] = useState(false);
|
const [showStartPicker, setShowStartPicker] = useState(false);
|
||||||
const [showEndPicker, setShowEndPicker] = useState(false);
|
const [showEndPicker, setShowEndPicker] = useState(false);
|
||||||
|
|
||||||
@@ -50,17 +52,46 @@ export default function DateRangePicker({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Dynamic styles based on theme
|
||||||
|
const themedStyles = {
|
||||||
|
label: {
|
||||||
|
color: colors.text,
|
||||||
|
},
|
||||||
|
dateInput: {
|
||||||
|
backgroundColor: colors.card,
|
||||||
|
borderColor: colors.border,
|
||||||
|
},
|
||||||
|
dateText: {
|
||||||
|
color: colors.text,
|
||||||
|
},
|
||||||
|
placeholder: {
|
||||||
|
color: colors.textSecondary,
|
||||||
|
},
|
||||||
|
pickerContainer: {
|
||||||
|
backgroundColor: colors.card,
|
||||||
|
},
|
||||||
|
pickerHeader: {
|
||||||
|
borderBottomColor: colors.border,
|
||||||
|
},
|
||||||
|
pickerTitle: {
|
||||||
|
color: colors.text,
|
||||||
|
},
|
||||||
|
cancelButton: {
|
||||||
|
color: colors.textSecondary,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text style={styles.label}>{t("diary.dateRangePicker.label")}</Text>
|
<Text style={[styles.label, themedStyles.label]}>{t("diary.dateRangePicker.label")}</Text>
|
||||||
<View style={styles.dateRangeContainer}>
|
<View style={styles.dateRangeContainer}>
|
||||||
{/* Start Date */}
|
{/* Start Date */}
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.dateInput}
|
style={[styles.dateInput, themedStyles.dateInput]}
|
||||||
onPress={() => setShowStartPicker(true)}
|
onPress={() => setShowStartPicker(true)}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Text style={[styles.dateText, !startDate && styles.placeholder]}>
|
<Text style={[styles.dateText, themedStyles.dateText, !startDate && themedStyles.placeholder]}>
|
||||||
{startDate ? formatDate(startDate) : t("diary.dateRangePicker.startDate")}
|
{startDate ? formatDate(startDate) : t("diary.dateRangePicker.startDate")}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@@ -68,17 +99,17 @@ export default function DateRangePicker({
|
|||||||
<Ionicons
|
<Ionicons
|
||||||
name="arrow-forward"
|
name="arrow-forward"
|
||||||
size={20}
|
size={20}
|
||||||
color="#9CA3AF"
|
color={colors.textSecondary}
|
||||||
style={styles.arrow}
|
style={styles.arrow}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* End Date */}
|
{/* End Date */}
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.dateInput}
|
style={[styles.dateInput, themedStyles.dateInput]}
|
||||||
onPress={() => setShowEndPicker(true)}
|
onPress={() => setShowEndPicker(true)}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Text style={[styles.dateText, !endDate && styles.placeholder]}>
|
<Text style={[styles.dateText, themedStyles.dateText, !endDate && themedStyles.placeholder]}>
|
||||||
{endDate ? formatDate(endDate) : t("diary.dateRangePicker.endDate")}
|
{endDate ? formatDate(endDate) : t("diary.dateRangePicker.endDate")}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@@ -87,7 +118,7 @@ export default function DateRangePicker({
|
|||||||
style={styles.calendarButton}
|
style={styles.calendarButton}
|
||||||
onPress={() => setShowStartPicker(true)}
|
onPress={() => setShowStartPicker(true)}
|
||||||
>
|
>
|
||||||
<Ionicons name="calendar-outline" size={20} color="#6B7280" />
|
<Ionicons name="calendar-outline" size={20} color={colors.textSecondary} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
@@ -95,12 +126,12 @@ export default function DateRangePicker({
|
|||||||
{showStartPicker && (
|
{showStartPicker && (
|
||||||
<Modal transparent animationType="fade" visible={showStartPicker}>
|
<Modal transparent animationType="fade" visible={showStartPicker}>
|
||||||
<View style={styles.modalOverlay}>
|
<View style={styles.modalOverlay}>
|
||||||
<View style={styles.pickerContainer}>
|
<View style={[styles.pickerContainer, themedStyles.pickerContainer]}>
|
||||||
<View style={styles.pickerHeader}>
|
<View style={[styles.pickerHeader, themedStyles.pickerHeader]}>
|
||||||
<TouchableOpacity onPress={() => setShowStartPicker(false)}>
|
<TouchableOpacity onPress={() => setShowStartPicker(false)}>
|
||||||
<Text style={styles.cancelButton}>{t("common.cancel")}</Text>
|
<Text style={[styles.cancelButton, themedStyles.cancelButton]}>{t("common.cancel")}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<Text style={styles.pickerTitle}>{t("diary.dateRangePicker.selectStartDate")}</Text>
|
<Text style={[styles.pickerTitle, themedStyles.pickerTitle]}>{t("diary.dateRangePicker.selectStartDate")}</Text>
|
||||||
<TouchableOpacity onPress={() => setShowStartPicker(false)}>
|
<TouchableOpacity onPress={() => setShowStartPicker(false)}>
|
||||||
<Text style={styles.doneButton}>{t("diary.dateRangePicker.done")}</Text>
|
<Text style={styles.doneButton}>{t("diary.dateRangePicker.done")}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@@ -111,6 +142,8 @@ export default function DateRangePicker({
|
|||||||
display={Platform.OS === "ios" ? "spinner" : "default"}
|
display={Platform.OS === "ios" ? "spinner" : "default"}
|
||||||
onChange={handleStartDateChange}
|
onChange={handleStartDateChange}
|
||||||
maximumDate={endDate || undefined}
|
maximumDate={endDate || undefined}
|
||||||
|
themeVariant={colorScheme}
|
||||||
|
textColor={colors.text}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@@ -121,12 +154,12 @@ export default function DateRangePicker({
|
|||||||
{showEndPicker && (
|
{showEndPicker && (
|
||||||
<Modal transparent animationType="fade" visible={showEndPicker}>
|
<Modal transparent animationType="fade" visible={showEndPicker}>
|
||||||
<View style={styles.modalOverlay}>
|
<View style={styles.modalOverlay}>
|
||||||
<View style={styles.pickerContainer}>
|
<View style={[styles.pickerContainer, themedStyles.pickerContainer]}>
|
||||||
<View style={styles.pickerHeader}>
|
<View style={[styles.pickerHeader, themedStyles.pickerHeader]}>
|
||||||
<TouchableOpacity onPress={() => setShowEndPicker(false)}>
|
<TouchableOpacity onPress={() => setShowEndPicker(false)}>
|
||||||
<Text style={styles.cancelButton}>{t("common.cancel")}</Text>
|
<Text style={[styles.cancelButton, themedStyles.cancelButton]}>{t("common.cancel")}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<Text style={styles.pickerTitle}>{t("diary.dateRangePicker.selectEndDate")}</Text>
|
<Text style={[styles.pickerTitle, themedStyles.pickerTitle]}>{t("diary.dateRangePicker.selectEndDate")}</Text>
|
||||||
<TouchableOpacity onPress={() => setShowEndPicker(false)}>
|
<TouchableOpacity onPress={() => setShowEndPicker(false)}>
|
||||||
<Text style={styles.doneButton}>{t("diary.dateRangePicker.done")}</Text>
|
<Text style={styles.doneButton}>{t("diary.dateRangePicker.done")}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@@ -137,6 +170,8 @@ export default function DateRangePicker({
|
|||||||
display={Platform.OS === "ios" ? "spinner" : "default"}
|
display={Platform.OS === "ios" ? "spinner" : "default"}
|
||||||
onChange={handleEndDateChange}
|
onChange={handleEndDateChange}
|
||||||
minimumDate={startDate || undefined}
|
minimumDate={startDate || undefined}
|
||||||
|
themeVariant={colorScheme}
|
||||||
|
textColor={colors.text}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@@ -153,7 +188,6 @@ const styles = StyleSheet.create({
|
|||||||
label: {
|
label: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
color: "#111827",
|
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
@@ -168,25 +202,19 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
dateInput: {
|
dateInput: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: "#FFFFFF",
|
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: "#D1D5DB",
|
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
paddingVertical: 12,
|
paddingVertical: 12,
|
||||||
},
|
},
|
||||||
dateText: {
|
dateText: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: "#111827",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
default: "System",
|
default: "System",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
placeholder: {
|
|
||||||
color: "#9CA3AF",
|
|
||||||
},
|
|
||||||
arrow: {
|
arrow: {
|
||||||
marginHorizontal: 4,
|
marginHorizontal: 4,
|
||||||
},
|
},
|
||||||
@@ -199,7 +227,6 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: "flex-end",
|
justifyContent: "flex-end",
|
||||||
},
|
},
|
||||||
pickerContainer: {
|
pickerContainer: {
|
||||||
backgroundColor: "#FFFFFF",
|
|
||||||
borderTopLeftRadius: 20,
|
borderTopLeftRadius: 20,
|
||||||
borderTopRightRadius: 20,
|
borderTopRightRadius: 20,
|
||||||
paddingBottom: 20,
|
paddingBottom: 20,
|
||||||
@@ -211,12 +238,10 @@ const styles = StyleSheet.create({
|
|||||||
paddingHorizontal: 20,
|
paddingHorizontal: 20,
|
||||||
paddingVertical: 16,
|
paddingVertical: 16,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: "#F3F4F6",
|
|
||||||
},
|
},
|
||||||
pickerTitle: {
|
pickerTitle: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
color: "#111827",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
@@ -225,7 +250,6 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
cancelButton: {
|
cancelButton: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: "#6B7280",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
@@ -243,3 +267,4 @@ const styles = StyleSheet.create({
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React from "react";
|
|||||||
import { TouchableOpacity, Text, StyleSheet, Platform } from "react-native";
|
import { TouchableOpacity, Text, StyleSheet, Platform } from "react-native";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { useI18n } from "@/hooks/use-i18n";
|
import { useI18n } from "@/hooks/use-i18n";
|
||||||
|
import { useThemeContext } from "@/hooks/use-theme-context";
|
||||||
|
|
||||||
interface FilterButtonProps {
|
interface FilterButtonProps {
|
||||||
onPress?: () => void;
|
onPress?: () => void;
|
||||||
@@ -13,26 +14,37 @@ export default function FilterButton({
|
|||||||
isFiltered,
|
isFiltered,
|
||||||
}: FilterButtonProps) {
|
}: FilterButtonProps) {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { colors } = useThemeContext();
|
||||||
|
|
||||||
|
const themedStyles = {
|
||||||
|
button: {
|
||||||
|
backgroundColor: colors.card,
|
||||||
|
borderColor: colors.border,
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
color: isFiltered ? colors.primary : colors.textSecondary,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.button}
|
style={[styles.button, themedStyles.button]}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name="filter"
|
name="filter"
|
||||||
size={20}
|
size={20}
|
||||||
color={isFiltered ? "#3B82F6" : "#374151"}
|
color={isFiltered ? colors.primary : colors.textSecondary}
|
||||||
/>
|
/>
|
||||||
<Text style={[styles.text, isFiltered && { color: "#3B82F6" }]}>
|
<Text style={[styles.text, themedStyles.text]}>
|
||||||
{t("diary.filter")}
|
{t("diary.filter")}
|
||||||
</Text>
|
</Text>
|
||||||
{isFiltered && (
|
{isFiltered && (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name="ellipse"
|
name="ellipse"
|
||||||
size={10}
|
size={10}
|
||||||
color="#3B82F6"
|
color={colors.primary}
|
||||||
style={{ marginLeft: 4 }}
|
style={{ marginLeft: 4 }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -45,12 +57,10 @@ const styles = StyleSheet.create({
|
|||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
backgroundColor: "#FFFFFF",
|
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
paddingHorizontal: 20,
|
paddingHorizontal: 20,
|
||||||
paddingVertical: 12,
|
paddingVertical: 12,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: "#E5E7EB",
|
|
||||||
shadowColor: "#000",
|
shadowColor: "#000",
|
||||||
shadowOffset: {
|
shadowOffset: {
|
||||||
width: 0,
|
width: 0,
|
||||||
@@ -63,7 +73,6 @@ const styles = StyleSheet.create({
|
|||||||
text: {
|
text: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: "500",
|
fontWeight: "500",
|
||||||
color: "#374151",
|
|
||||||
marginLeft: 8,
|
marginLeft: 8,
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import DateRangePicker from "./DateRangePicker";
|
|||||||
import ShipDropdown from "./ShipDropdown";
|
import ShipDropdown from "./ShipDropdown";
|
||||||
import { TripStatus } from "./types";
|
import { TripStatus } from "./types";
|
||||||
import { useI18n } from "@/hooks/use-i18n";
|
import { useI18n } from "@/hooks/use-i18n";
|
||||||
|
import { useThemeContext } from "@/hooks/use-theme-context";
|
||||||
|
|
||||||
// Map status number to string - now uses i18n
|
// Map status number to string - now uses i18n
|
||||||
export function useMapStatusNumberToString() {
|
export function useMapStatusNumberToString() {
|
||||||
@@ -63,6 +64,7 @@ export default function FilterModal({
|
|||||||
onApply,
|
onApply,
|
||||||
}: FilterModalProps) {
|
}: FilterModalProps) {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { colors } = useThemeContext();
|
||||||
const mapStatusNumberToString = useMapStatusNumberToString();
|
const mapStatusNumberToString = useMapStatusNumberToString();
|
||||||
const [status, setStatus] = useState<TripStatus | null>(null);
|
const [status, setStatus] = useState<TripStatus | null>(null);
|
||||||
const [startDate, setStartDate] = useState<Date | null>(null);
|
const [startDate, setStartDate] = useState<Date | null>(null);
|
||||||
@@ -87,6 +89,42 @@ export default function FilterModal({
|
|||||||
endDate !== null ||
|
endDate !== null ||
|
||||||
selectedShip !== null;
|
selectedShip !== null;
|
||||||
|
|
||||||
|
const themedStyles = {
|
||||||
|
modalContainer: {
|
||||||
|
backgroundColor: colors.card,
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
borderBottomColor: colors.separator,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
color: colors.text,
|
||||||
|
},
|
||||||
|
previewContainer: {
|
||||||
|
backgroundColor: colors.backgroundSecondary,
|
||||||
|
},
|
||||||
|
previewTitle: {
|
||||||
|
color: colors.textSecondary,
|
||||||
|
},
|
||||||
|
filterTag: {
|
||||||
|
backgroundColor: colors.primary + '20', // 20% opacity
|
||||||
|
},
|
||||||
|
filterTagText: {
|
||||||
|
color: colors.primary,
|
||||||
|
},
|
||||||
|
footer: {
|
||||||
|
borderTopColor: colors.separator,
|
||||||
|
},
|
||||||
|
resetButton: {
|
||||||
|
backgroundColor: colors.backgroundSecondary,
|
||||||
|
},
|
||||||
|
resetButtonText: {
|
||||||
|
color: colors.textSecondary,
|
||||||
|
},
|
||||||
|
applyButton: {
|
||||||
|
backgroundColor: colors.primary,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
visible={visible}
|
visible={visible}
|
||||||
@@ -100,16 +138,16 @@ export default function FilterModal({
|
|||||||
onPress={onClose}
|
onPress={onClose}
|
||||||
>
|
>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.modalContainer}
|
style={[styles.modalContainer, themedStyles.modalContainer]}
|
||||||
activeOpacity={1}
|
activeOpacity={1}
|
||||||
onPress={(e) => e.stopPropagation()}
|
onPress={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<View style={styles.header}>
|
<View style={[styles.header, themedStyles.header]}>
|
||||||
<TouchableOpacity onPress={onClose} style={styles.closeButton}>
|
<TouchableOpacity onPress={onClose} style={styles.closeButton}>
|
||||||
<Ionicons name="close" size={24} color="#111827" />
|
<Ionicons name="close" size={24} color={colors.text} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<Text style={styles.title}>{t("diary.filter")}</Text>
|
<Text style={[styles.title, themedStyles.title]}>{t("diary.filter")}</Text>
|
||||||
<View style={styles.placeholder} />
|
<View style={styles.placeholder} />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
@@ -129,32 +167,32 @@ export default function FilterModal({
|
|||||||
|
|
||||||
{/* Filter Results Preview */}
|
{/* Filter Results Preview */}
|
||||||
{hasFilters && (
|
{hasFilters && (
|
||||||
<View style={styles.previewContainer}>
|
<View style={[styles.previewContainer, themedStyles.previewContainer]}>
|
||||||
<Text style={styles.previewTitle}>{t("diary.selectedFilters")}</Text>
|
<Text style={[styles.previewTitle, themedStyles.previewTitle]}>{t("diary.selectedFilters")}</Text>
|
||||||
{status !== null && (
|
{status !== null && (
|
||||||
<View style={styles.filterTag}>
|
<View style={[styles.filterTag, themedStyles.filterTag]}>
|
||||||
<Text style={styles.filterTagText}>
|
<Text style={[styles.filterTagText, themedStyles.filterTagText]}>
|
||||||
{t("diary.statusLabel")} {mapStatusNumberToString(status)}
|
{t("diary.statusLabel")} {mapStatusNumberToString(status)}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{startDate && (
|
{startDate && (
|
||||||
<View style={styles.filterTag}>
|
<View style={[styles.filterTag, themedStyles.filterTag]}>
|
||||||
<Text style={styles.filterTagText}>
|
<Text style={[styles.filterTagText, themedStyles.filterTagText]}>
|
||||||
{t("diary.fromLabel")} {startDate.toLocaleDateString("vi-VN")}
|
{t("diary.fromLabel")} {startDate.toLocaleDateString("vi-VN")}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{endDate && (
|
{endDate && (
|
||||||
<View style={styles.filterTag}>
|
<View style={[styles.filterTag, themedStyles.filterTag]}>
|
||||||
<Text style={styles.filterTagText}>
|
<Text style={[styles.filterTagText, themedStyles.filterTagText]}>
|
||||||
{t("diary.toLabel")} {endDate.toLocaleDateString("vi-VN")}
|
{t("diary.toLabel")} {endDate.toLocaleDateString("vi-VN")}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{selectedShip && (
|
{selectedShip && (
|
||||||
<View style={styles.filterTag}>
|
<View style={[styles.filterTag, themedStyles.filterTag]}>
|
||||||
<Text style={styles.filterTagText}>
|
<Text style={[styles.filterTagText, themedStyles.filterTagText]}>
|
||||||
{t("diary.shipLabel")} {selectedShip.shipName}
|
{t("diary.shipLabel")} {selectedShip.shipName}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -164,16 +202,16 @@ export default function FilterModal({
|
|||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
{/* Footer */}
|
{/* Footer */}
|
||||||
<View style={styles.footer}>
|
<View style={[styles.footer, themedStyles.footer]}>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.resetButton}
|
style={[styles.resetButton, themedStyles.resetButton]}
|
||||||
onPress={handleReset}
|
onPress={handleReset}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Text style={styles.resetButtonText}>{t("diary.reset")}</Text>
|
<Text style={[styles.resetButtonText, themedStyles.resetButtonText]}>{t("diary.reset")}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.applyButton}
|
style={[styles.applyButton, themedStyles.applyButton]}
|
||||||
onPress={handleApply}
|
onPress={handleApply}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
@@ -186,6 +224,7 @@ export default function FilterModal({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
overlay: {
|
overlay: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@@ -193,7 +232,6 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: "flex-end",
|
justifyContent: "flex-end",
|
||||||
},
|
},
|
||||||
modalContainer: {
|
modalContainer: {
|
||||||
backgroundColor: "#FFFFFF",
|
|
||||||
borderTopLeftRadius: 24,
|
borderTopLeftRadius: 24,
|
||||||
borderTopRightRadius: 24,
|
borderTopRightRadius: 24,
|
||||||
maxHeight: "80%",
|
maxHeight: "80%",
|
||||||
@@ -213,7 +251,6 @@ const styles = StyleSheet.create({
|
|||||||
paddingHorizontal: 20,
|
paddingHorizontal: 20,
|
||||||
paddingVertical: 16,
|
paddingVertical: 16,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: "#F3F4F6",
|
|
||||||
},
|
},
|
||||||
closeButton: {
|
closeButton: {
|
||||||
padding: 4,
|
padding: 4,
|
||||||
@@ -221,7 +258,6 @@ const styles = StyleSheet.create({
|
|||||||
title: {
|
title: {
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
fontWeight: "700",
|
fontWeight: "700",
|
||||||
color: "#111827",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
@@ -237,13 +273,11 @@ const styles = StyleSheet.create({
|
|||||||
previewContainer: {
|
previewContainer: {
|
||||||
marginTop: 20,
|
marginTop: 20,
|
||||||
padding: 16,
|
padding: 16,
|
||||||
backgroundColor: "#F9FAFB",
|
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
},
|
},
|
||||||
previewTitle: {
|
previewTitle: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
color: "#6B7280",
|
|
||||||
marginBottom: 12,
|
marginBottom: 12,
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
@@ -252,7 +286,6 @@ const styles = StyleSheet.create({
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
filterTag: {
|
filterTag: {
|
||||||
backgroundColor: "#EFF6FF",
|
|
||||||
paddingHorizontal: 12,
|
paddingHorizontal: 12,
|
||||||
paddingVertical: 6,
|
paddingVertical: 6,
|
||||||
borderRadius: 16,
|
borderRadius: 16,
|
||||||
@@ -261,7 +294,6 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
filterTagText: {
|
filterTagText: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: "#3B82F6",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
@@ -273,11 +305,9 @@ const styles = StyleSheet.create({
|
|||||||
gap: 12,
|
gap: 12,
|
||||||
padding: 20,
|
padding: 20,
|
||||||
borderTopWidth: 1,
|
borderTopWidth: 1,
|
||||||
borderTopColor: "#F3F4F6",
|
|
||||||
},
|
},
|
||||||
resetButton: {
|
resetButton: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: "#F3F4F6",
|
|
||||||
paddingVertical: 14,
|
paddingVertical: 14,
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
@@ -285,7 +315,6 @@ const styles = StyleSheet.create({
|
|||||||
resetButtonText: {
|
resetButtonText: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
color: "#6B7280",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
@@ -294,7 +323,6 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
applyButton: {
|
applyButton: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: "#3B82F6",
|
|
||||||
paddingVertical: 14,
|
paddingVertical: 14,
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { useThings } from "@/state/use-thing";
|
import { useThings } from "@/state/use-thing";
|
||||||
import { useI18n } from "@/hooks/use-i18n";
|
import { useI18n } from "@/hooks/use-i18n";
|
||||||
|
import { useThemeContext } from "@/hooks/use-theme-context";
|
||||||
|
|
||||||
interface ShipOption {
|
interface ShipOption {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -25,6 +26,7 @@ interface ShipDropdownProps {
|
|||||||
|
|
||||||
export default function ShipDropdown({ value, onChange }: ShipDropdownProps) {
|
export default function ShipDropdown({ value, onChange }: ShipDropdownProps) {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { colors } = useThemeContext();
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [searchText, setSearchText] = useState("");
|
const [searchText, setSearchText] = useState("");
|
||||||
|
|
||||||
@@ -53,18 +55,32 @@ export default function ShipDropdown({ value, onChange }: ShipDropdownProps) {
|
|||||||
|
|
||||||
const displayValue = value ? value.shipName : t("diary.shipDropdown.placeholder");
|
const displayValue = value ? value.shipName : t("diary.shipDropdown.placeholder");
|
||||||
|
|
||||||
|
const themedStyles = {
|
||||||
|
label: { color: colors.text },
|
||||||
|
selector: { backgroundColor: colors.card, borderColor: colors.border },
|
||||||
|
selectorText: { color: colors.text },
|
||||||
|
placeholder: { color: colors.textSecondary },
|
||||||
|
modalContent: { backgroundColor: colors.card },
|
||||||
|
searchContainer: { backgroundColor: colors.backgroundSecondary, borderColor: colors.border },
|
||||||
|
searchInput: { color: colors.text },
|
||||||
|
option: { borderBottomColor: colors.separator },
|
||||||
|
selectedOption: { backgroundColor: colors.backgroundSecondary },
|
||||||
|
optionText: { color: colors.text },
|
||||||
|
emptyText: { color: colors.textSecondary },
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text style={styles.label}>{t("diary.shipDropdown.label")}</Text>
|
<Text style={[styles.label, themedStyles.label]}>{t("diary.shipDropdown.label")}</Text>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.selector}
|
style={[styles.selector, themedStyles.selector]}
|
||||||
onPress={() => setIsOpen(true)}
|
onPress={() => setIsOpen(true)}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Text style={[styles.selectorText, !value && styles.placeholder]}>
|
<Text style={[styles.selectorText, themedStyles.selectorText, !value && themedStyles.placeholder]}>
|
||||||
{displayValue}
|
{displayValue}
|
||||||
</Text>
|
</Text>
|
||||||
<Ionicons name="chevron-down" size={20} color="#6B7280" />
|
<Ionicons name="chevron-down" size={20} color={colors.textSecondary} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
@@ -79,80 +95,73 @@ export default function ShipDropdown({ value, onChange }: ShipDropdownProps) {
|
|||||||
onPress={() => setIsOpen(false)}
|
onPress={() => setIsOpen(false)}
|
||||||
>
|
>
|
||||||
<View
|
<View
|
||||||
style={styles.modalContent}
|
style={[styles.modalContent, themedStyles.modalContent]}
|
||||||
onStartShouldSetResponder={() => true}
|
onStartShouldSetResponder={() => true}
|
||||||
>
|
>
|
||||||
{/* Search Input */}
|
{/* Search Input */}
|
||||||
<View style={styles.searchContainer}>
|
<View style={[styles.searchContainer, themedStyles.searchContainer]}>
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name="search"
|
name="search"
|
||||||
size={20}
|
size={20}
|
||||||
color="#9CA3AF"
|
color={colors.textSecondary}
|
||||||
style={styles.searchIcon}
|
style={styles.searchIcon}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
style={styles.searchInput}
|
style={[styles.searchInput, themedStyles.searchInput]}
|
||||||
placeholder={t("diary.shipDropdown.searchPlaceholder")}
|
placeholder={t("diary.shipDropdown.searchPlaceholder")}
|
||||||
placeholderTextColor="#9CA3AF"
|
placeholderTextColor={colors.textSecondary}
|
||||||
value={searchText}
|
value={searchText}
|
||||||
onChangeText={setSearchText}
|
onChangeText={setSearchText}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
/>
|
/>
|
||||||
{searchText.length > 0 && (
|
{searchText.length > 0 && (
|
||||||
<TouchableOpacity onPress={() => setSearchText("")}>
|
<TouchableOpacity onPress={() => setSearchText("")}>
|
||||||
<Ionicons name="close-circle" size={20} color="#9CA3AF" />
|
<Ionicons name="close-circle" size={20} color={colors.textSecondary} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<ScrollView style={styles.optionsList}>
|
<ScrollView style={styles.optionsList}>
|
||||||
{/* Option to clear selection */}
|
{/* "All Ships" option */}
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={[styles.option, !value && styles.selectedOption]}
|
style={[
|
||||||
|
styles.option,
|
||||||
|
themedStyles.option,
|
||||||
|
!value && themedStyles.selectedOption,
|
||||||
|
]}
|
||||||
onPress={() => handleSelect(null)}
|
onPress={() => handleSelect(null)}
|
||||||
>
|
>
|
||||||
<Text
|
<Text style={[styles.optionText, themedStyles.optionText]}>
|
||||||
style={[
|
|
||||||
styles.optionText,
|
|
||||||
styles.placeholderOption,
|
|
||||||
!value && styles.selectedOptionText,
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
{t("diary.shipDropdown.allShips")}
|
{t("diary.shipDropdown.allShips")}
|
||||||
</Text>
|
</Text>
|
||||||
{!value && (
|
{!value && (
|
||||||
<Ionicons name="checkmark" size={20} color="#3B82F6" />
|
<Ionicons name="checkmark" size={20} color={colors.primary} />
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
{filteredShips.map((ship) => (
|
{/* Filtered ship options */}
|
||||||
<TouchableOpacity
|
{filteredShips.length > 0 ? (
|
||||||
key={ship.id}
|
filteredShips.map((ship) => (
|
||||||
style={[
|
<TouchableOpacity
|
||||||
styles.option,
|
key={ship.id}
|
||||||
value?.id === ship.id && styles.selectedOption,
|
style={[
|
||||||
]}
|
styles.option,
|
||||||
onPress={() => handleSelect(ship)}
|
themedStyles.option,
|
||||||
>
|
value?.id === ship.id && themedStyles.selectedOption,
|
||||||
<View style={styles.shipInfo}>
|
]}
|
||||||
<Text
|
onPress={() => handleSelect(ship)}
|
||||||
style={[
|
>
|
||||||
styles.shipName,
|
<Text style={[styles.optionText, themedStyles.optionText]}>
|
||||||
value?.id === ship.id && styles.selectedOptionText,
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
{ship.shipName}
|
{ship.shipName}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
{value?.id === ship.id && (
|
||||||
{value?.id === ship.id && (
|
<Ionicons name="checkmark" size={20} color={colors.primary} />
|
||||||
<Ionicons name="checkmark" size={20} color="#3B82F6" />
|
)}
|
||||||
)}
|
</TouchableOpacity>
|
||||||
</TouchableOpacity>
|
))
|
||||||
))}
|
) : (
|
||||||
|
<View style={styles.emptyContainer}>
|
||||||
{filteredShips.length === 0 && searchText.length > 0 && (
|
<Text style={[styles.emptyText, themedStyles.emptyText]}>
|
||||||
<View style={styles.emptyState}>
|
|
||||||
<Text style={styles.emptyText}>
|
|
||||||
{t("diary.shipDropdown.noShipsFound")}
|
{t("diary.shipDropdown.noShipsFound")}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -172,7 +181,6 @@ const styles = StyleSheet.create({
|
|||||||
label: {
|
label: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
color: "#111827",
|
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
@@ -184,16 +192,13 @@ const styles = StyleSheet.create({
|
|||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
backgroundColor: "#FFFFFF",
|
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: "#D1D5DB",
|
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
paddingVertical: 12,
|
paddingVertical: 12,
|
||||||
},
|
},
|
||||||
selectorText: {
|
selectorText: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: "#111827",
|
|
||||||
flex: 1,
|
flex: 1,
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
@@ -201,9 +206,6 @@ const styles = StyleSheet.create({
|
|||||||
default: "System",
|
default: "System",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
placeholder: {
|
|
||||||
color: "#9CA3AF",
|
|
||||||
},
|
|
||||||
modalOverlay: {
|
modalOverlay: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
||||||
@@ -211,7 +213,6 @@ const styles = StyleSheet.create({
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
modalContent: {
|
modalContent: {
|
||||||
backgroundColor: "#FFFFFF",
|
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
width: "85%",
|
width: "85%",
|
||||||
maxHeight: "70%",
|
maxHeight: "70%",
|
||||||
@@ -231,8 +232,6 @@ const styles = StyleSheet.create({
|
|||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
paddingVertical: 12,
|
paddingVertical: 12,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: "#F3F4F6",
|
|
||||||
backgroundColor: "#F9FAFB",
|
|
||||||
},
|
},
|
||||||
searchIcon: {
|
searchIcon: {
|
||||||
marginRight: 8,
|
marginRight: 8,
|
||||||
@@ -240,7 +239,6 @@ const styles = StyleSheet.create({
|
|||||||
searchInput: {
|
searchInput: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: "#111827",
|
|
||||||
padding: 0,
|
padding: 0,
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
@@ -258,58 +256,21 @@ const styles = StyleSheet.create({
|
|||||||
paddingHorizontal: 20,
|
paddingHorizontal: 20,
|
||||||
paddingVertical: 16,
|
paddingVertical: 16,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: "#F3F4F6",
|
|
||||||
},
|
|
||||||
selectedOption: {
|
|
||||||
backgroundColor: "#EFF6FF",
|
|
||||||
},
|
},
|
||||||
optionText: {
|
optionText: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: "#111827",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
default: "System",
|
default: "System",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
placeholderOption: {
|
emptyContainer: {
|
||||||
fontStyle: "italic",
|
|
||||||
color: "#6B7280",
|
|
||||||
},
|
|
||||||
selectedOptionText: {
|
|
||||||
color: "#3B82F6",
|
|
||||||
fontWeight: "600",
|
|
||||||
},
|
|
||||||
shipInfo: {
|
|
||||||
flex: 1,
|
|
||||||
},
|
|
||||||
shipName: {
|
|
||||||
fontSize: 16,
|
|
||||||
color: "#111827",
|
|
||||||
fontWeight: "500",
|
|
||||||
marginBottom: 2,
|
|
||||||
fontFamily: Platform.select({
|
|
||||||
ios: "System",
|
|
||||||
android: "Roboto",
|
|
||||||
default: "System",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
regNumber: {
|
|
||||||
fontSize: 14,
|
|
||||||
color: "#6B7280",
|
|
||||||
fontFamily: Platform.select({
|
|
||||||
ios: "System",
|
|
||||||
android: "Roboto",
|
|
||||||
default: "System",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
emptyState: {
|
|
||||||
paddingVertical: 24,
|
paddingVertical: 24,
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
emptyText: {
|
emptyText: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: "#9CA3AF",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { TripStatus } from "./types";
|
import { TripStatus } from "./types";
|
||||||
import { useI18n } from "@/hooks/use-i18n";
|
import { useI18n } from "@/hooks/use-i18n";
|
||||||
|
import { useThemeContext } from "@/hooks/use-theme-context";
|
||||||
|
|
||||||
interface StatusDropdownProps {
|
interface StatusDropdownProps {
|
||||||
value: TripStatus | null;
|
value: TripStatus | null;
|
||||||
@@ -22,6 +23,7 @@ export default function StatusDropdown({
|
|||||||
onChange,
|
onChange,
|
||||||
}: StatusDropdownProps) {
|
}: StatusDropdownProps) {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { colors } = useThemeContext();
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
|
||||||
const STATUS_OPTIONS: Array<{ value: TripStatus | null; label: string }> = [
|
const STATUS_OPTIONS: Array<{ value: TripStatus | null; label: string }> = [
|
||||||
@@ -42,18 +44,29 @@ export default function StatusDropdown({
|
|||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const themedStyles = {
|
||||||
|
label: { color: colors.text },
|
||||||
|
selector: { backgroundColor: colors.card, borderColor: colors.border },
|
||||||
|
selectorText: { color: colors.text },
|
||||||
|
placeholder: { color: colors.textSecondary },
|
||||||
|
modalContent: { backgroundColor: colors.card },
|
||||||
|
option: { borderBottomColor: colors.separator },
|
||||||
|
selectedOption: { backgroundColor: colors.backgroundSecondary },
|
||||||
|
optionText: { color: colors.text },
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text style={styles.label}>{t("diary.statusDropdown.label")}</Text>
|
<Text style={[styles.label, themedStyles.label]}>{t("diary.statusDropdown.label")}</Text>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.selector}
|
style={[styles.selector, themedStyles.selector]}
|
||||||
onPress={() => setIsOpen(true)}
|
onPress={() => setIsOpen(true)}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Text style={[styles.selectorText, !value && styles.placeholder]}>
|
<Text style={[styles.selectorText, themedStyles.selectorText, !value && themedStyles.placeholder]}>
|
||||||
{selectedLabel}
|
{selectedLabel}
|
||||||
</Text>
|
</Text>
|
||||||
<Ionicons name="ellipsis-horizontal" size={20} color="#6B7280" />
|
<Ionicons name="ellipsis-horizontal" size={20} color={colors.textSecondary} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
@@ -67,27 +80,28 @@ export default function StatusDropdown({
|
|||||||
activeOpacity={1}
|
activeOpacity={1}
|
||||||
onPress={() => setIsOpen(false)}
|
onPress={() => setIsOpen(false)}
|
||||||
>
|
>
|
||||||
<View style={styles.modalContent}>
|
<View style={[styles.modalContent, themedStyles.modalContent]}>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
{STATUS_OPTIONS.map((option, index) => (
|
{STATUS_OPTIONS.map((option, index) => (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
key={index}
|
key={index}
|
||||||
style={[
|
style={[
|
||||||
styles.option,
|
styles.option,
|
||||||
value === option.value && styles.selectedOption,
|
themedStyles.option,
|
||||||
|
value === option.value && themedStyles.selectedOption,
|
||||||
]}
|
]}
|
||||||
onPress={() => handleSelect(option.value)}
|
onPress={() => handleSelect(option.value)}
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
style={[
|
style={[
|
||||||
styles.optionText,
|
styles.optionText,
|
||||||
value === option.value && styles.selectedOptionText,
|
themedStyles.optionText,
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{option.label}
|
{option.label}
|
||||||
</Text>
|
</Text>
|
||||||
{value === option.value && (
|
{value === option.value && (
|
||||||
<Ionicons name="checkmark" size={20} color="#3B82F6" />
|
<Ionicons name="checkmark" size={20} color={colors.primary} />
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
))}
|
))}
|
||||||
@@ -106,7 +120,6 @@ const styles = StyleSheet.create({
|
|||||||
label: {
|
label: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
color: "#111827",
|
|
||||||
marginBottom: 8,
|
marginBottom: 8,
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
@@ -118,25 +131,19 @@ const styles = StyleSheet.create({
|
|||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
backgroundColor: "#FFFFFF",
|
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: "#D1D5DB",
|
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
paddingVertical: 12,
|
paddingVertical: 12,
|
||||||
},
|
},
|
||||||
selectorText: {
|
selectorText: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: "#111827",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
default: "System",
|
default: "System",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
placeholder: {
|
|
||||||
color: "#9CA3AF",
|
|
||||||
},
|
|
||||||
modalOverlay: {
|
modalOverlay: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
||||||
@@ -144,7 +151,6 @@ const styles = StyleSheet.create({
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
modalContent: {
|
modalContent: {
|
||||||
backgroundColor: "#FFFFFF",
|
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
width: "80%",
|
width: "80%",
|
||||||
maxHeight: "60%",
|
maxHeight: "60%",
|
||||||
@@ -165,22 +171,13 @@ const styles = StyleSheet.create({
|
|||||||
paddingHorizontal: 20,
|
paddingHorizontal: 20,
|
||||||
paddingVertical: 16,
|
paddingVertical: 16,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: "#F3F4F6",
|
|
||||||
},
|
|
||||||
selectedOption: {
|
|
||||||
backgroundColor: "#EFF6FF",
|
|
||||||
},
|
},
|
||||||
optionText: {
|
optionText: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: "#111827",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
default: "System",
|
default: "System",
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
selectedOptionText: {
|
|
||||||
color: "#3B82F6",
|
|
||||||
fontWeight: "600",
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { useTripStatusConfig } from "./types";
|
|||||||
import { useThings } from "@/state/use-thing";
|
import { useThings } from "@/state/use-thing";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { useI18n } from "@/hooks/use-i18n";
|
import { useI18n } from "@/hooks/use-i18n";
|
||||||
|
import { useThemeContext } from "@/hooks/use-theme-context";
|
||||||
|
|
||||||
interface TripCardProps {
|
interface TripCardProps {
|
||||||
trip: Model.Trip;
|
trip: Model.Trip;
|
||||||
@@ -32,6 +33,7 @@ export default function TripCard({
|
|||||||
onDelete,
|
onDelete,
|
||||||
}: TripCardProps) {
|
}: TripCardProps) {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { colors } = useThemeContext();
|
||||||
const { things } = useThings();
|
const { things } = useThings();
|
||||||
const TRIP_STATUS_CONFIG = useTripStatusConfig();
|
const TRIP_STATUS_CONFIG = useTripStatusConfig();
|
||||||
|
|
||||||
@@ -54,8 +56,30 @@ export default function TripCard({
|
|||||||
const showSend = trip.trip_status === 0;
|
const showSend = trip.trip_status === 0;
|
||||||
const showDelete = trip.trip_status === 1;
|
const showDelete = trip.trip_status === 1;
|
||||||
|
|
||||||
|
const themedStyles = {
|
||||||
|
card: {
|
||||||
|
backgroundColor: colors.card,
|
||||||
|
borderColor: colors.border,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
color: colors.text,
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
color: colors.textSecondary,
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
color: colors.text,
|
||||||
|
},
|
||||||
|
divider: {
|
||||||
|
backgroundColor: colors.separator,
|
||||||
|
},
|
||||||
|
actionText: {
|
||||||
|
color: colors.textSecondary,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.card}>
|
<View style={[styles.card, themedStyles.card]}>
|
||||||
<TouchableOpacity onPress={onPress} activeOpacity={0.7}>
|
<TouchableOpacity onPress={onPress} activeOpacity={0.7}>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<View style={styles.header}>
|
<View style={styles.header}>
|
||||||
@@ -66,7 +90,7 @@ export default function TripCard({
|
|||||||
color={statusConfig.textColor}
|
color={statusConfig.textColor}
|
||||||
/>
|
/>
|
||||||
<View style={styles.titleContainer}>
|
<View style={styles.titleContainer}>
|
||||||
<Text style={styles.title}>{trip.name}</Text>
|
<Text style={[styles.title, themedStyles.title]}>{trip.name}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View
|
<View
|
||||||
@@ -93,15 +117,15 @@ export default function TripCard({
|
|||||||
{/* Info Grid */}
|
{/* Info Grid */}
|
||||||
<View style={styles.infoGrid}>
|
<View style={styles.infoGrid}>
|
||||||
<View style={styles.infoRow}>
|
<View style={styles.infoRow}>
|
||||||
<Text style={styles.label}>{t("diary.tripCard.shipCode")}</Text>
|
<Text style={[styles.label, themedStyles.label]}>{t("diary.tripCard.shipCode")}</Text>
|
||||||
<Text style={styles.value}>
|
<Text style={[styles.value, themedStyles.value]}>
|
||||||
{thingOfTrip?.metadata?.ship_reg_number /* hoặc trip.ship_id */}
|
{thingOfTrip?.metadata?.ship_reg_number /* hoặc trip.ship_id */}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={styles.infoRow}>
|
<View style={styles.infoRow}>
|
||||||
<Text style={styles.label}>{t("diary.tripCard.departure")}</Text>
|
<Text style={[styles.label, themedStyles.label]}>{t("diary.tripCard.departure")}</Text>
|
||||||
<Text style={styles.value}>
|
<Text style={[styles.value, themedStyles.value]}>
|
||||||
{trip.departure_time
|
{trip.departure_time
|
||||||
? dayjs(trip.departure_time).format("DD/MM/YYYY HH:mm")
|
? dayjs(trip.departure_time).format("DD/MM/YYYY HH:mm")
|
||||||
: "-"}
|
: "-"}
|
||||||
@@ -109,9 +133,9 @@ export default function TripCard({
|
|||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={styles.infoRow}>
|
<View style={styles.infoRow}>
|
||||||
<Text style={styles.label}>{t("diary.tripCard.return")}</Text>
|
<Text style={[styles.label, themedStyles.label]}>{t("diary.tripCard.return")}</Text>
|
||||||
{/* FIXME: trip.returnDate không có trong dữ liệu API, cần mapping từ trip.arrival_time */}
|
{/* FIXME: trip.returnDate không có trong dữ liệu API, cần mapping từ trip.arrival_time */}
|
||||||
<Text style={styles.value}>
|
<Text style={[styles.value, themedStyles.value]}>
|
||||||
{trip.arrival_time
|
{trip.arrival_time
|
||||||
? dayjs(trip.arrival_time).format("DD/MM/YYYY HH:mm")
|
? dayjs(trip.arrival_time).format("DD/MM/YYYY HH:mm")
|
||||||
: "-"}
|
: "-"}
|
||||||
@@ -121,15 +145,15 @@ export default function TripCard({
|
|||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
{/* Action Buttons */}
|
{/* Action Buttons */}
|
||||||
<View style={styles.divider} />
|
<View style={[styles.divider, themedStyles.divider]} />
|
||||||
<View style={styles.actionsContainer}>
|
<View style={styles.actionsContainer}>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styles.actionButton}
|
style={styles.actionButton}
|
||||||
onPress={onView}
|
onPress={onView}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Ionicons name="eye-outline" size={20} color="#6B7280" />
|
<Ionicons name="eye-outline" size={20} color={colors.textSecondary} />
|
||||||
<Text style={styles.actionText}>{t("diary.tripCard.view")}</Text>
|
<Text style={[styles.actionText, themedStyles.actionText]}>{t("diary.tripCard.view")}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
{showEdit && (
|
{showEdit && (
|
||||||
@@ -138,8 +162,8 @@ export default function TripCard({
|
|||||||
onPress={onEdit}
|
onPress={onEdit}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Ionicons name="create-outline" size={20} color="#6B7280" />
|
<Ionicons name="create-outline" size={20} color={colors.textSecondary} />
|
||||||
<Text style={styles.actionText}>{t("diary.tripCard.edit")}</Text>
|
<Text style={[styles.actionText, themedStyles.actionText]}>{t("diary.tripCard.edit")}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -148,8 +172,8 @@ export default function TripCard({
|
|||||||
onPress={onTeam}
|
onPress={onTeam}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Ionicons name="people-outline" size={20} color="#6B7280" />
|
<Ionicons name="people-outline" size={20} color={colors.textSecondary} />
|
||||||
<Text style={styles.actionText}>{t("diary.tripCard.team")}</Text>
|
<Text style={[styles.actionText, themedStyles.actionText]}>{t("diary.tripCard.team")}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
{showSend && (
|
{showSend && (
|
||||||
@@ -158,8 +182,8 @@ export default function TripCard({
|
|||||||
onPress={onSend}
|
onPress={onSend}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Ionicons name="send-outline" size={20} color="#6B7280" />
|
<Ionicons name="send-outline" size={20} color={colors.textSecondary} />
|
||||||
<Text style={styles.actionText}>{t("diary.tripCard.send")}</Text>
|
<Text style={[styles.actionText, themedStyles.actionText]}>{t("diary.tripCard.send")}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -169,7 +193,7 @@ export default function TripCard({
|
|||||||
onPress={onDelete}
|
onPress={onDelete}
|
||||||
activeOpacity={0.7}
|
activeOpacity={0.7}
|
||||||
>
|
>
|
||||||
<Ionicons name="trash-outline" size={20} color="#EF4444" />
|
<Ionicons name="trash-outline" size={20} color={colors.error} />
|
||||||
<Text style={[styles.actionText, styles.deleteText]}>{t("diary.tripCard.delete")}</Text>
|
<Text style={[styles.actionText, styles.deleteText]}>{t("diary.tripCard.delete")}</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
@@ -180,7 +204,6 @@ export default function TripCard({
|
|||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
card: {
|
card: {
|
||||||
backgroundColor: "#FFFFFF",
|
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
padding: 16,
|
padding: 16,
|
||||||
marginBottom: 12,
|
marginBottom: 12,
|
||||||
@@ -193,7 +216,6 @@ const styles = StyleSheet.create({
|
|||||||
shadowRadius: 8,
|
shadowRadius: 8,
|
||||||
elevation: 2,
|
elevation: 2,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: "#F3F4F6",
|
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
@@ -213,7 +235,6 @@ const styles = StyleSheet.create({
|
|||||||
title: {
|
title: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: "600",
|
fontWeight: "600",
|
||||||
color: "#111827",
|
|
||||||
marginBottom: 2,
|
marginBottom: 2,
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
@@ -238,15 +259,15 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
infoGrid: {
|
infoGrid: {
|
||||||
gap: 12,
|
gap: 12,
|
||||||
|
marginBottom: 12,
|
||||||
},
|
},
|
||||||
infoRow: {
|
infoRow: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
alignItems: "center",
|
paddingVertical: 8,
|
||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: "#6B7280",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
@@ -255,9 +276,7 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
value: {
|
value: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: "#111827",
|
|
||||||
fontWeight: "500",
|
fontWeight: "500",
|
||||||
textAlign: "right",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
@@ -266,25 +285,20 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
divider: {
|
divider: {
|
||||||
height: 1,
|
height: 1,
|
||||||
backgroundColor: "#F3F4F6",
|
marginVertical: 12,
|
||||||
marginTop: 16,
|
|
||||||
},
|
},
|
||||||
actionsContainer: {
|
actionsContainer: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-around",
|
justifyContent: "space-around",
|
||||||
paddingTop: 12,
|
alignItems: "center",
|
||||||
},
|
},
|
||||||
actionButton: {
|
actionButton: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
gap: 6,
|
gap: 4,
|
||||||
paddingVertical: 8,
|
|
||||||
paddingHorizontal: 12,
|
|
||||||
},
|
},
|
||||||
actionText: {
|
actionText: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: "#6B7280",
|
|
||||||
fontWeight: "500",
|
|
||||||
fontFamily: Platform.select({
|
fontFamily: Platform.select({
|
||||||
ios: "System",
|
ios: "System",
|
||||||
android: "Roboto",
|
android: "Roboto",
|
||||||
|
|||||||
Reference in New Issue
Block a user