cập nhật themes cho tab
This commit is contained in:
@@ -2,6 +2,7 @@ import React from "react";
|
||||
import { TouchableOpacity, Text, StyleSheet, Platform } from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { useI18n } from "@/hooks/use-i18n";
|
||||
import { useThemeContext } from "@/hooks/use-theme-context";
|
||||
|
||||
interface FilterButtonProps {
|
||||
onPress?: () => void;
|
||||
@@ -13,26 +14,37 @@ export default function FilterButton({
|
||||
isFiltered,
|
||||
}: FilterButtonProps) {
|
||||
const { t } = useI18n();
|
||||
const { colors } = useThemeContext();
|
||||
|
||||
const themedStyles = {
|
||||
button: {
|
||||
backgroundColor: colors.card,
|
||||
borderColor: colors.border,
|
||||
},
|
||||
text: {
|
||||
color: isFiltered ? colors.primary : colors.textSecondary,
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<TouchableOpacity
|
||||
style={styles.button}
|
||||
style={[styles.button, themedStyles.button]}
|
||||
onPress={onPress}
|
||||
activeOpacity={0.7}
|
||||
>
|
||||
<Ionicons
|
||||
name="filter"
|
||||
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")}
|
||||
</Text>
|
||||
{isFiltered && (
|
||||
<Ionicons
|
||||
name="ellipse"
|
||||
size={10}
|
||||
color="#3B82F6"
|
||||
color={colors.primary}
|
||||
style={{ marginLeft: 4 }}
|
||||
/>
|
||||
)}
|
||||
@@ -45,12 +57,10 @@ const styles = StyleSheet.create({
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
backgroundColor: "#FFFFFF",
|
||||
borderRadius: 12,
|
||||
paddingHorizontal: 20,
|
||||
paddingVertical: 12,
|
||||
borderWidth: 1,
|
||||
borderColor: "#E5E7EB",
|
||||
shadowColor: "#000",
|
||||
shadowOffset: {
|
||||
width: 0,
|
||||
@@ -63,7 +73,6 @@ const styles = StyleSheet.create({
|
||||
text: {
|
||||
fontSize: 16,
|
||||
fontWeight: "500",
|
||||
color: "#374151",
|
||||
marginLeft: 8,
|
||||
fontFamily: Platform.select({
|
||||
ios: "System",
|
||||
|
||||
Reference in New Issue
Block a user