update
This commit is contained in:
@@ -11,6 +11,8 @@ import {
|
||||
ScrollView,
|
||||
TouchableWithoutFeedback,
|
||||
Keyboard,
|
||||
KeyboardAvoidingView,
|
||||
Platform,
|
||||
} from 'react-native';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
import Input from './Input';
|
||||
@@ -199,113 +201,118 @@ const EditProfileModal = ({
|
||||
onRequestClose={handleClose}
|
||||
>
|
||||
<SafeAreaView style={styles.container}>
|
||||
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
||||
<View style={styles.content}>
|
||||
{/* Header */}
|
||||
<View style={styles.header}>
|
||||
<TouchableOpacity onPress={handleClose} style={styles.closeButton}>
|
||||
<Ionicons name="close" size={24} color={COLORS.text} />
|
||||
</TouchableOpacity>
|
||||
<Text style={styles.title}>Şahsy maglumatlar</Text>
|
||||
<View style={styles.placeholder} />
|
||||
</View>
|
||||
|
||||
{/* Form */}
|
||||
<ScrollView style={styles.form} showsVerticalScrollIndicator={false}>
|
||||
<View style={styles.formSection}>
|
||||
<Text style={styles.sectionTitle}>Esasy maglumatlar</Text>
|
||||
|
||||
<Input
|
||||
label="Ady *"
|
||||
value={formData.name}
|
||||
onChangeText={(value) => updateFormData('name', value)}
|
||||
error={errors.name}
|
||||
maxLength={255}
|
||||
returnKeyType="next"
|
||||
onSubmitEditing={() => phoneInputRef.current?.focus()}
|
||||
/>
|
||||
|
||||
<Input
|
||||
ref={phoneInputRef}
|
||||
label="Telefon belgisi *"
|
||||
value={formData.phone}
|
||||
onChangeText={(value) => updateFormData('phone', value)}
|
||||
error={errors.phone}
|
||||
keyboardType="numeric"
|
||||
maxLength={8}
|
||||
returnKeyType="next"
|
||||
onSubmitEditing={() => passwordInputRef.current?.focus()}
|
||||
/>
|
||||
|
||||
<Input
|
||||
ref={passwordInputRef}
|
||||
label="Täze parol"
|
||||
value={formData.password}
|
||||
onChangeText={(value) => updateFormData('password', value)}
|
||||
error={errors.password}
|
||||
secureTextEntry
|
||||
placeholder="Parol üýtgetmezlik üçin boş goýuň"
|
||||
returnKeyType="next"
|
||||
onSubmitEditing={() => passportIdInputRef.current?.focus()}
|
||||
/>
|
||||
<KeyboardAvoidingView
|
||||
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||
style={{ flex: 1 }}
|
||||
>
|
||||
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
||||
<View style={styles.content}>
|
||||
{/* Header */}
|
||||
<View style={styles.header}>
|
||||
<TouchableOpacity onPress={handleClose} style={styles.closeButton}>
|
||||
<Ionicons name="close" size={24} color={COLORS.text} />
|
||||
</TouchableOpacity>
|
||||
<Text style={styles.title}>Şahsy maglumatlar</Text>
|
||||
<View style={styles.placeholder} />
|
||||
</View>
|
||||
|
||||
<View style={styles.formSection}>
|
||||
<Text style={styles.sectionTitle}>Passport maglumatlary</Text>
|
||||
{/* Form */}
|
||||
<ScrollView style={styles.form} showsVerticalScrollIndicator={false}>
|
||||
<View style={styles.formSection}>
|
||||
<Text style={styles.sectionTitle}>Esasy maglumatlar</Text>
|
||||
|
||||
<View style={styles.inputContainer}>
|
||||
<Text style={styles.label}>Passport seriýasy</Text>
|
||||
<TouchableOpacity
|
||||
style={[styles.pickerButton, errors.passport_serie && styles.inputError]}
|
||||
onPress={() => setShowPassportPicker(true)}
|
||||
>
|
||||
<Text style={[styles.pickerButtonText, !formData.passport_serie && styles.placeholderText]}>
|
||||
{formData.passport_serie || 'Saýlaň'}
|
||||
</Text>
|
||||
<Ionicons name="chevron-down" size={20} color={COLORS.textSecondary} />
|
||||
</TouchableOpacity>
|
||||
{errors.passport_serie && (
|
||||
<Text style={styles.errorText}>{errors.passport_serie}</Text>
|
||||
)}
|
||||
<Input
|
||||
label="Ady *"
|
||||
value={formData.name}
|
||||
onChangeText={(value) => updateFormData('name', value)}
|
||||
error={errors.name}
|
||||
maxLength={255}
|
||||
returnKeyType="next"
|
||||
onSubmitEditing={() => phoneInputRef.current?.focus()}
|
||||
/>
|
||||
|
||||
<Input
|
||||
ref={phoneInputRef}
|
||||
label="Telefon belgisi *"
|
||||
value={formData.phone}
|
||||
onChangeText={(value) => updateFormData('phone', value)}
|
||||
error={errors.phone}
|
||||
keyboardType="numeric"
|
||||
maxLength={8}
|
||||
returnKeyType="next"
|
||||
onSubmitEditing={() => passwordInputRef.current?.focus()}
|
||||
/>
|
||||
|
||||
<Input
|
||||
ref={passwordInputRef}
|
||||
label="Täze parol"
|
||||
value={formData.password}
|
||||
onChangeText={(value) => updateFormData('password', value)}
|
||||
error={errors.password}
|
||||
secureTextEntry
|
||||
placeholder="Parol üýtgetmezlik üçin boş goýuň"
|
||||
returnKeyType="next"
|
||||
onSubmitEditing={() => passportIdInputRef.current?.focus()}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<Input
|
||||
ref={passportIdInputRef}
|
||||
label="Passport ID"
|
||||
value={formData.passport_id}
|
||||
onChangeText={(value) => updateFormData('passport_id', value)}
|
||||
error={errors.passport_id}
|
||||
keyboardType="numeric"
|
||||
returnKeyType="done"
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.formSection}>
|
||||
<Text style={styles.sectionTitle}>Passport maglumatlary</Text>
|
||||
|
||||
<View style={styles.note}>
|
||||
<Ionicons name="information-circle" size={16} color={COLORS.textSecondary} />
|
||||
<Text style={styles.noteText}>
|
||||
* belgisi bolan meýdanlar hökmany doldurulmaly
|
||||
</Text>
|
||||
</View>
|
||||
</ScrollView>
|
||||
<View style={styles.inputContainer}>
|
||||
<Text style={styles.label}>Passport seriýasy</Text>
|
||||
<TouchableOpacity
|
||||
style={[styles.pickerButton, errors.passport_serie && styles.inputError]}
|
||||
onPress={() => setShowPassportPicker(true)}
|
||||
>
|
||||
<Text style={[styles.pickerButtonText, !formData.passport_serie && styles.placeholderText]}>
|
||||
{formData.passport_serie || 'Saýlaň'}
|
||||
</Text>
|
||||
<Ionicons name="chevron-down" size={20} color={COLORS.textSecondary} />
|
||||
</TouchableOpacity>
|
||||
{errors.passport_serie && (
|
||||
<Text style={styles.errorText}>{errors.passport_serie}</Text>
|
||||
)}
|
||||
</View>
|
||||
|
||||
{/* Save Button */}
|
||||
<View style={styles.footer}>
|
||||
<Button
|
||||
title="Ýatda sakla"
|
||||
onPress={handleSave}
|
||||
disabled={isLoading}
|
||||
style={styles.saveButton}
|
||||
/>
|
||||
{isLoading && (
|
||||
<ActivityIndicator
|
||||
size="small"
|
||||
color={COLORS.primary}
|
||||
style={styles.loader}
|
||||
<Input
|
||||
ref={passportIdInputRef}
|
||||
label="Passport ID"
|
||||
value={formData.passport_id}
|
||||
onChangeText={(value) => updateFormData('passport_id', value)}
|
||||
error={errors.passport_id}
|
||||
keyboardType="numeric"
|
||||
returnKeyType="done"
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View style={styles.note}>
|
||||
<Ionicons name="information-circle" size={16} color={COLORS.textSecondary} />
|
||||
<Text style={styles.noteText}>
|
||||
* belgisi bolan meýdanlar hökmany doldurulmaly
|
||||
</Text>
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
||||
{/* Save Button */}
|
||||
<View style={styles.footer}>
|
||||
<Button
|
||||
title="Ýatda sakla"
|
||||
onPress={handleSave}
|
||||
disabled={isLoading}
|
||||
style={styles.saveButton}
|
||||
/>
|
||||
)}
|
||||
{isLoading && (
|
||||
<ActivityIndicator
|
||||
size="small"
|
||||
color={COLORS.primary}
|
||||
style={styles.loader}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</TouchableWithoutFeedback>
|
||||
</TouchableWithoutFeedback>
|
||||
</KeyboardAvoidingView>
|
||||
|
||||
{renderPassportSeriesPicker()}
|
||||
</SafeAreaView>
|
||||
|
||||
@@ -103,7 +103,6 @@ const styles = StyleSheet.create({
|
||||
backgroundColor: COLORS.backgroundSecondary,
|
||||
},
|
||||
header: {
|
||||
backgroundColor: COLORS.white,
|
||||
paddingHorizontal: 24,
|
||||
paddingTop: 16,
|
||||
paddingBottom: 24,
|
||||
|
||||
Reference in New Issue
Block a user