@@ -41,10 +41,13 @@ import {
4141import { router } from "expo-router" ;
4242import { MaterialIcons } from "@expo/vector-icons" ;
4343import { useAuth } from "@contexts/AuthContext" ;
44+ import { useTheme } from "@contexts/ThemeContext" ;
4445import { loginStyles } from "@styles/auth/loginStyles" ;
4546
4647const ForgotPasswordScreen : React . FC = ( ) => {
4748 const { forgotPassword, isLoading, error, clearError } = useAuth ( ) ;
49+ const { colors } = useTheme ( ) ;
50+ const styles = loginStyles ( colors ) ;
4851 const [ email , setEmail ] = useState < string > ( "" ) ;
4952 const [ emailSent , setEmailSent ] = useState < boolean > ( false ) ;
5053
@@ -103,36 +106,34 @@ const ForgotPasswordScreen: React.FC = () => {
103106
104107 if ( emailSent ) {
105108 return (
106- < KeyboardAvoidingView style = { loginStyles . container } behavior = { "height" } >
107- < ScrollView contentContainerStyle = { loginStyles . scrollContainer } >
108- < View style = { loginStyles . formContainer } >
109- < View style = { loginStyles . header } >
109+ < KeyboardAvoidingView style = { styles . container } behavior = { "height" } >
110+ < ScrollView contentContainerStyle = { styles . scrollContainer } >
111+ < View style = { styles . formContainer } >
112+ < View style = { styles . header } >
110113 < MaterialIcons name = "mail-outline" size = { 64 } color = "#2563eb" />
111- < Text style = { loginStyles . title } > Check Your Email</ Text >
112- < Text style = { loginStyles . subtitle } >
114+ < Text style = { styles . title } > Check Your Email</ Text >
115+ < Text style = { styles . subtitle } >
113116 If an account with that email exists, you should receive a
114117 password reset link shortly.
115118 </ Text >
116119 </ View >
117120
118- < View style = { loginStyles . successContainer } >
119- < Text style = { loginStyles . successText } >
121+ < View style = { styles . successContainer } >
122+ < Text style = { styles . successText } >
120123 Please check your email inbox and spam folder for the password
121124 reset link.
122125 </ Text >
123- < Text style = { loginStyles . successSubtext } >
126+ < Text style = { styles . successSubtext } >
124127 The reset link will expire in 1 hour for security reasons.
125128 </ Text >
126129 </ View >
127130
128- < View style = { loginStyles . buttonContainer } >
131+ < View style = { styles . buttonContainer } >
129132 < TouchableOpacity
130- style = { loginStyles . resetPrimaryButton }
133+ style = { styles . resetPrimaryButton }
131134 onPress = { handleBackToLogin }
132135 >
133- < Text style = { loginStyles . resetPrimaryButtonText } >
134- Back to Login
135- </ Text >
136+ < Text style = { styles . resetPrimaryButtonText } > Back to Login</ Text >
136137 </ TouchableOpacity >
137138 </ View >
138139 </ View >
@@ -142,38 +143,46 @@ const ForgotPasswordScreen: React.FC = () => {
142143 }
143144
144145 return (
145- < KeyboardAvoidingView style = { loginStyles . container } behavior = { "height" } >
146- < ScrollView contentContainerStyle = { loginStyles . scrollContainer } >
147- < View style = { loginStyles . formContainer } >
148- < View style = { loginStyles . header } >
149- < MaterialIcons name = "lock-outline" size = { 64 } color = "#2563eb" />
150- < Text style = { loginStyles . title } > Forgot Password</ Text >
151- < Text style = { loginStyles . subtitle } >
146+ < KeyboardAvoidingView style = { styles . container } behavior = { "height" } >
147+ < ScrollView contentContainerStyle = { styles . scrollContainer } >
148+ < View style = { styles . formContainer } >
149+ < View style = { styles . header } >
150+ < MaterialIcons
151+ name = "lock-outline"
152+ size = { 64 }
153+ color = { colors . primary }
154+ />
155+ < Text style = { styles . title } > Forgot Password</ Text >
156+ < Text style = { styles . subtitle } >
152157 {
153158 "Enter your email address and we'll send you a link to reset your password."
154159 }
155160 </ Text >
156161 </ View >
157162
158163 { error ? (
159- < View style = { loginStyles . errorContainer } >
160- < MaterialIcons name = "error-outline" size = { 20 } color = "#dc2626" />
161- < Text style = { loginStyles . errorText } > { error } </ Text >
164+ < View style = { styles . errorContainer } >
165+ < MaterialIcons
166+ name = "error-outline"
167+ size = { 20 }
168+ color = { colors . error }
169+ />
170+ < Text style = { styles . errorText } > { error } </ Text >
162171 </ View >
163172 ) : null }
164173
165- < View style = { loginStyles . inputContainer } >
166- < View style = { loginStyles . inputWrapper } >
174+ < View style = { styles . inputContainer } >
175+ < View style = { styles . inputWrapper } >
167176 < MaterialIcons
168177 name = "email"
169178 size = { 20 }
170- color = "#6b7280"
171- style = { loginStyles . inputIcon }
179+ color = { colors . textMuted }
180+ style = { styles . inputIcon }
172181 />
173182 < TextInput
174- style = { loginStyles . input }
183+ style = { styles . input }
175184 placeholder = "Enter your email address"
176- placeholderTextColor = "#9ca3af"
185+ placeholderTextColor = { colors . textMuted }
177186 value = { email }
178187 onChangeText = { text => {
179188 setEmail ( text ) ;
@@ -192,12 +201,12 @@ const ForgotPasswordScreen: React.FC = () => {
192201 </ View >
193202 </ View >
194203
195- < View style = { loginStyles . buttonContainer } >
204+ < View style = { styles . buttonContainer } >
196205 < TouchableOpacity
197206 style = { [
198- loginStyles . resetPrimaryButton ,
207+ styles . resetPrimaryButton ,
199208 ( isLoading || ! email . trim ( ) || ! validateEmail ( email . trim ( ) ) ) &&
200- loginStyles . primaryButtonDisabled ,
209+ styles . primaryButtonDisabled ,
201210 ] }
202211 onPress = { handleForgotPassword }
203212 disabled = {
@@ -206,25 +215,25 @@ const ForgotPasswordScreen: React.FC = () => {
206215 >
207216 < Text
208217 style = { [
209- loginStyles . resetPrimaryButtonText ,
218+ styles . resetPrimaryButtonText ,
210219 ( isLoading ||
211220 ! email . trim ( ) ||
212221 ! validateEmail ( email . trim ( ) ) ) &&
213- loginStyles . primaryButtonTextDisabled ,
222+ styles . primaryButtonTextDisabled ,
214223 ] }
215224 >
216225 { isLoading ? "Sending..." : "Send Reset Link" }
217226 </ Text >
218227 </ TouchableOpacity >
219228 </ View >
220229
221- < View style = { loginStyles . footerLinks } >
230+ < View style = { styles . footerLinks } >
222231 < TouchableOpacity onPress = { handleBackToLogin } >
223- < Text style = { loginStyles . linkText } > Back to Login</ Text >
232+ < Text style = { styles . linkText } > Back to Login</ Text >
224233 </ TouchableOpacity >
225- < Text style = { loginStyles . linkSeparator } > •</ Text >
234+ < Text style = { styles . linkSeparator } > •</ Text >
226235 < TouchableOpacity onPress = { handleCreateAccount } >
227- < Text style = { loginStyles . linkText } > Create Account</ Text >
236+ < Text style = { styles . linkText } > Create Account</ Text >
228237 </ TouchableOpacity >
229238 </ View >
230239 </ View >
0 commit comments