@@ -48,6 +48,7 @@ import { ROUTES } from '@/navigation/routes'
4848import { Button } from '@/shared/components/ui/Button'
4949import { ScreenWrapper } from '@/shared/components/ui/ScreenWrapper'
5050import { Text } from '@/shared/components/ui/Text'
51+ import { useToggle } from '@/shared/hooks/useToggle'
5152import { useTheme } from '@/shared/theme'
5253import { normalizeError } from '@/shared/utils/normalize-error'
5354import { showErrorToast } from '@/shared/utils/toast'
@@ -352,9 +353,9 @@ export default function AuthScreen() {
352353 const [ password , setPassword ] = useState ( ( ) =>
353354 flags . USE_MOCK ? AUTH_MOCK_DEMO . password : '' ,
354355 )
355- const [ showPassword , setShowPassword ] = useState ( false )
356- const [ emailFocused , setEmailFocused ] = useState ( false )
357- const [ passFocused , setPassFocused ] = useState ( false )
356+ const [ showPassword , toggleShowPassword ] = useToggle ( false )
357+ const [ emailFocused , , setEmailFocused , clearEmailFocused ] = useToggle ( false )
358+ const [ passFocused , , setPassFocused , clearPassFocused ] = useToggle ( false )
358359
359360 // Input focus — Reanimated shared values for color interpolation
360361 const emailFocus = useSharedValue ( 0 )
@@ -692,11 +693,11 @@ export default function AuthScreen() {
692693 value = { email }
693694 onChangeText = { setEmail }
694695 onFocus = { ( ) => {
695- setEmailFocused ( true )
696+ setEmailFocused ( )
696697 animateFocus ( emailFocus , true )
697698 } }
698699 onBlur = { ( ) => {
699- setEmailFocused ( false )
700+ clearEmailFocused ( )
700701 animateFocus ( emailFocus , false )
701702 } }
702703 keyboardType = "email-address"
@@ -742,11 +743,11 @@ export default function AuthScreen() {
742743 value = { password }
743744 onChangeText = { setPassword }
744745 onFocus = { ( ) => {
745- setPassFocused ( true )
746+ setPassFocused ( )
746747 animateFocus ( passFocus , true )
747748 } }
748749 onBlur = { ( ) => {
749- setPassFocused ( false )
750+ clearPassFocused ( )
750751 animateFocus ( passFocus , false )
751752 } }
752753 secureTextEntry = { ! showPassword }
@@ -756,7 +757,7 @@ export default function AuthScreen() {
756757 textContentType = "password"
757758 />
758759 < TouchableOpacity
759- onPress = { ( ) => setShowPassword ( ! showPassword ) }
760+ onPress = { toggleShowPassword }
760761 activeOpacity = { 0.6 }
761762 style = { styles . eyeSlot }
762763 >
0 commit comments