bug fixes
This commit is contained in:
@@ -20,6 +20,12 @@ const yearOptions = Array.from({ length: 60 }).map((_, i) => {
|
||||
|
||||
const PASSPORT_SERIES = ['I-AS','I-MR','II-MR','I-AH','II-AH','I-LB','II-LB','I-BN','II-BN','I-DZ','II-DZ'];
|
||||
|
||||
// Helper to format card number with spaces
|
||||
const formatCardNumber = (value) => {
|
||||
const digits = String(value).replace(/[^0-9]/g, '').slice(0, 16);
|
||||
return (digits.match(/.{1,4}/g) || []).join(' ');
|
||||
};
|
||||
|
||||
const CreateCardBalanceOrderScreen = () => {
|
||||
const navigation = useNavigation();
|
||||
const [cardNumber, setCardNumber] = useState('');
|
||||
@@ -42,7 +48,11 @@ const CreateCardBalanceOrderScreen = () => {
|
||||
useEffect(() => {
|
||||
if (user) {
|
||||
if (user.passport_serie) setPassportSerie(user.passport_serie);
|
||||
if (user.passport_id) setPassportId(String(user.passport_id));
|
||||
if (user.passport_id) setPassportId(String(user.passport_id));e
|
||||
|
||||
if (user.card_number) setCardNumber(formatCardNumber(user.card_number));
|
||||
if (user.card_month) setCardMonth(String(user.card_month).padStart(2, '0'));
|
||||
if (user.card_year) setCardYear(String(user.card_year));
|
||||
}
|
||||
}, [user]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user