Open History to see the last commit
1import { useGT } from "gt-react-native";
2import { Pressable } from "react-native";
3
4import { SymbolView } from "./AppSymbol";
5
6/** Eye toggle that shows or hides a secret field's typed text. */
7export function SecretRevealButton(props: {
8 readonly revealed: boolean;
9 readonly onPress: () => void;
10}) {
11 const gt = useGT();
12 return (
13 <Pressable
14 onPress={props.onPress}
15 hitSlop={6}
16 accessibilityRole="button"
17 accessibilityLabel={props.revealed ? gt("Hide secret") : gt("Show secret")}
18 className="size-10 items-center justify-center"
19 >
20 <SymbolView
21 name={props.revealed ? "eye.slash" : "eye"}
22 size={18}
23 tintColorClassName="accent-icon-muted"
24 />
25 </Pressable>
26 );
27}