Loading mobile/src/profile/components/change_password_form.tsx 0 → 100644 +67 −0 Original line number Diff line number Diff line import { Control, Controller } from "react-hook-form"; import { View } from "react-native"; import { EditProfileFormValues } from "../../hooks/useEditProfile"; import { CustomTextInput } from "../../common/components/form/text_input"; interface ChangePasswordFormProps { control: any; isActive?: boolean; } export const ChangePasswordForm = ({ control, isActive }: ChangePasswordFormProps) => { return ( <View style={{width: '100%', marginTop: 20, gap: 20}}> <Controller name="oldPassword" control={control} render={({ field: { onChange, onBlur, value }, fieldState: { error } }) => ( <CustomTextInput onBlur={onBlur} value={value ?? ""} label="Old password" errors={error?.message} editable={isActive} isPassword textInputProps={{ onChangeText: onChange, }} /> )} /> <Controller name="newPassword" control={control} render={({ field: { onChange, onBlur, value }, fieldState: { error } }) => ( <CustomTextInput onBlur={onBlur} value={value ?? ""} label="New password" isPassword errors={error?.message} editable={isActive} textInputProps={{ onChangeText: onChange, }} /> )} /> <Controller name="confirmPassword" control={control} render={({ field: { onChange, onBlur, value }, fieldState: { error } }) => ( <CustomTextInput onBlur={onBlur} value={value ?? ""} label="Confirm password" isPassword errors={error?.message} editable={isActive} textInputProps={{ onChangeText: onChange, }} /> )} /> </View> ); } No newline at end of file Loading
mobile/src/profile/components/change_password_form.tsx 0 → 100644 +67 −0 Original line number Diff line number Diff line import { Control, Controller } from "react-hook-form"; import { View } from "react-native"; import { EditProfileFormValues } from "../../hooks/useEditProfile"; import { CustomTextInput } from "../../common/components/form/text_input"; interface ChangePasswordFormProps { control: any; isActive?: boolean; } export const ChangePasswordForm = ({ control, isActive }: ChangePasswordFormProps) => { return ( <View style={{width: '100%', marginTop: 20, gap: 20}}> <Controller name="oldPassword" control={control} render={({ field: { onChange, onBlur, value }, fieldState: { error } }) => ( <CustomTextInput onBlur={onBlur} value={value ?? ""} label="Old password" errors={error?.message} editable={isActive} isPassword textInputProps={{ onChangeText: onChange, }} /> )} /> <Controller name="newPassword" control={control} render={({ field: { onChange, onBlur, value }, fieldState: { error } }) => ( <CustomTextInput onBlur={onBlur} value={value ?? ""} label="New password" isPassword errors={error?.message} editable={isActive} textInputProps={{ onChangeText: onChange, }} /> )} /> <Controller name="confirmPassword" control={control} render={({ field: { onChange, onBlur, value }, fieldState: { error } }) => ( <CustomTextInput onBlur={onBlur} value={value ?? ""} label="Confirm password" isPassword errors={error?.message} editable={isActive} textInputProps={{ onChangeText: onChange, }} /> )} /> </View> ); } No newline at end of file