From 1349ad7dc0901ef59cd2feeb450bb5da173fa8f7 Mon Sep 17 00:00:00 2001 From: Gauvain Date: Wed, 3 Jun 2026 23:19:21 +0200 Subject: [PATCH] feat(settings): add SettingsRow component --- components/settings/index/SettingsRow.tsx | 62 +++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 components/settings/index/SettingsRow.tsx diff --git a/components/settings/index/SettingsRow.tsx b/components/settings/index/SettingsRow.tsx new file mode 100644 index 000000000..c3b949a3b --- /dev/null +++ b/components/settings/index/SettingsRow.tsx @@ -0,0 +1,62 @@ +import { Ionicons } from "@expo/vector-icons"; +import type React from "react"; +import { TouchableOpacity, View } from "react-native"; +import { Text } from "@/components/common/Text"; +import { useHaptic } from "@/hooks/useHaptic"; + +export interface SettingsRowProps { + title: string; + icon: keyof typeof Ionicons.glyphMap; + value?: string; + showChevron?: boolean; + onPress: () => void; + isLast?: boolean; +} + +const ACCENT = "#a855f7"; // single accent (full theming is a separate sub-project) + +export const SettingsRow: React.FC = ({ + title, + icon, + value, + showChevron = true, + onPress, + isLast = false, +}) => { + const haptic = useHaptic("light"); // no-op when disableHapticFeedback is set + + return ( + { + haptic(); + onPress(); + }} + className={`flex flex-row items-center bg-neutral-900 h-[48px] px-3 ${ + isLast ? "" : "border-b border-[#ffffff14]" + }`} + > + + + + + {title} + + {value ? ( + + {value} + + ) : null} + {showChevron ? ( + + ) : null} + + ); +};