chore: update
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import AsyncStorage from "@react-native-async-storage/async-storage";
|
||||
import { useCart } from "../../context/CartContext";
|
||||
import { checkoutCart, getReferralBalance } from "../../api/api";
|
||||
import type { ClientStackParamList } from "../../navigation/types";
|
||||
@@ -45,6 +46,15 @@ export default function CheckoutScreen() {
|
||||
getReferralBalance().then((res) => {
|
||||
if (res.success && res.balance > 0) setReferralBalance(res.balance);
|
||||
});
|
||||
AsyncStorage.multiGet([
|
||||
"profile_default_address",
|
||||
"profile_default_phone",
|
||||
]).then((pairs) => {
|
||||
const savedAddress = pairs[0][1];
|
||||
const savedPhone = pairs[1][1];
|
||||
if (savedAddress) setAddress(savedAddress);
|
||||
if (savedPhone) setTelephone(savedPhone);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const handleCheckout = async () => {
|
||||
@@ -199,6 +209,12 @@ export default function CheckoutScreen() {
|
||||
marginTop: spacing.s,
|
||||
lineHeight: 16,
|
||||
},
|
||||
prefillHint: {
|
||||
color: "#6ee7b7",
|
||||
fontSize: fontSize.xs,
|
||||
marginTop: 4,
|
||||
opacity: 0.85,
|
||||
},
|
||||
invalidAddrContent: { gap: spacing.m },
|
||||
invalidAddrIconContainer: { alignItems: "center" },
|
||||
invalidAddrIconCircle: {
|
||||
@@ -378,6 +394,11 @@ export default function CheckoutScreen() {
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
{!!telephone && (
|
||||
<Text style={styles.prefillHint}>
|
||||
Pre-rempli depuis votre profil
|
||||
</Text>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -411,6 +432,11 @@ export default function CheckoutScreen() {
|
||||
multiline
|
||||
numberOfLines={3}
|
||||
/>
|
||||
{!!address && (
|
||||
<Text style={styles.prefillHint}>
|
||||
Pre-rempli depuis votre profil — modifiez si vous etes ailleurs
|
||||
</Text>
|
||||
)}
|
||||
</View>
|
||||
|
||||
{/* Section parrainage — visible uniquement si solde > 0 */}
|
||||
|
||||
Reference in New Issue
Block a user