complated project

This commit is contained in:
Samandar Turgunboyev
2026-02-02 18:51:53 +05:00
parent f0183e4573
commit a7419929f8
57 changed files with 3035 additions and 477 deletions

View File

@@ -209,7 +209,7 @@ export default function CreateAdsScreens() {
behavior="padding"
style={[styles.safeArea, isDark ? styles.darkBg : styles.lightBg]}
>
<ScrollView contentContainerStyle={styles.container}>
<ScrollView contentContainerStyle={[styles.container, { paddingBottom: 90 }]}>
<Text style={[styles.title, isDark ? styles.darkText : styles.lightText]}>
{currentStep === 1
? t("E'lon ma'lumotlari")
@@ -235,43 +235,47 @@ export default function CreateAdsScreens() {
/>
)}
{currentStep === 4 && <StepFour data={ads} setPayment={setPaymentType} />}
<View style={styles.footer}>
{currentStep > 1 && currentStep !== 4 && (
<TouchableOpacity
style={[styles.back, isDark ? styles.darkBack : styles.lightBack]}
onPress={() => setCurrentStep((s) => s - 1)}
>
<Text style={[styles.btnText, isDark ? styles.darkBtnText : styles.lightBtnText]}>
{t('Orqaga')}
</Text>
</TouchableOpacity>
)}
<TouchableOpacity
style={styles.next}
disabled={isPending}
onPress={() => {
let isValid = true;
if (currentStep === 1) isValid = stepOneRef.current?.validate() ?? false;
if (currentStep === 2) isValid = stepTwoRef.current?.validate() ?? false;
if (currentStep === 3) isValid = stepThreeRef.current?.validate() ?? false;
if (!isValid) return;
if (currentStep < 3) setCurrentStep((s) => s + 1);
if (currentStep === 3) handleSubmit();
if (currentStep === 4) handlePresentModalPress();
}}
>
<Text style={styles.btnText}>
{currentStep === 3
? t('Yaratish')
: currentStep === 4
? t("To'lash")
: t('Keyingisi')}
</Text>
</TouchableOpacity>
</View>
</ScrollView>
{/* FOOTER */}
<View style={styles.footer}>
{currentStep > 1 && currentStep !== 4 && (
<TouchableOpacity
style={[styles.back, isDark ? styles.darkBack : styles.lightBack]}
onPress={() => setCurrentStep((s) => s - 1)}
>
<Text style={[styles.btnText, isDark ? styles.darkBtnText : styles.lightBtnText]}>
{t('Orqaga')}
</Text>
</TouchableOpacity>
)}
<TouchableOpacity
style={styles.next}
disabled={isPending}
onPress={() => {
let isValid = true;
if (currentStep === 1) isValid = stepOneRef.current?.validate() ?? false;
if (currentStep === 2) isValid = stepTwoRef.current?.validate() ?? false;
if (currentStep === 3) isValid = stepThreeRef.current?.validate() ?? false;
if (!isValid) return;
if (currentStep < 3) setCurrentStep((s) => s + 1);
if (currentStep === 3) handleSubmit();
if (currentStep === 4) handlePresentModalPress();
}}
>
<Text style={styles.btnText}>
{currentStep === 3 ? t('Yaratish') : currentStep === 4 ? t("To'lash") : t('Keyingisi')}
</Text>
</TouchableOpacity>
</View>
{/* PAYMENT BOTTOM SHEET */}
<BottomSheetModal
@@ -329,7 +333,7 @@ const styles = StyleSheet.create({
lightBg: {
backgroundColor: '#f8fafc',
},
container: { padding: 20, paddingBottom: 140 },
container: { padding: 20 },
title: { fontSize: 22, fontWeight: '800', marginBottom: 20 },
darkText: {
color: '#f1f5f9',
@@ -339,12 +343,8 @@ const styles = StyleSheet.create({
},
footer: {
position: 'absolute',
bottom: 80,
left: 20,
right: 20,
flexDirection: 'row',
gap: 10,
marginTop: 10,
gap: 5,
},
back: {
flex: 1,