Compare commits
No commits in common. "f46d9cdc8d202d21f1f7d0d6704d3499087ef64a" and "2a2a95ecf0625b114fbd1e304bb8f6924e1fe3b1" have entirely different histories.
f46d9cdc8d
...
2a2a95ecf0
|
|
@ -294,13 +294,11 @@ export const AuthModal: React.FC<AuthModalProps> = ({
|
|||
value={authDialCode}
|
||||
onChange={(e) => {
|
||||
const newCode = e.target.value;
|
||||
if (newCode !== authDialCode) {
|
||||
setAuthDialCode(newCode);
|
||||
const rule = getCountryRuleByDialCode(newCode);
|
||||
if (rule && rule.country !== 'Other') {
|
||||
setAuthCountry(rule.country);
|
||||
}
|
||||
setAuthPhone('');
|
||||
setAuthDialCode(newCode);
|
||||
const rule = getCountryRuleByDialCode(newCode);
|
||||
if (rule && rule.country !== 'Other') {
|
||||
setAuthCountry(rule.country);
|
||||
setAuthPhone(cleanPhoneInput(authPhone, rule.maxLength, false));
|
||||
}
|
||||
}}
|
||||
className="w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-2.5 text-xs sm:text-sm font-semibold text-white focus:outline-none focus:border-indigo-500 appearance-none pr-6"
|
||||
|
|
@ -343,13 +341,11 @@ export const AuthModal: React.FC<AuthModalProps> = ({
|
|||
value={authCountry}
|
||||
onChange={(e) => {
|
||||
const newCountry = e.target.value;
|
||||
if (newCountry !== authCountry) {
|
||||
setAuthCountry(newCountry);
|
||||
const rule = getCountryRuleByName(newCountry);
|
||||
if (rule) {
|
||||
setAuthDialCode(rule.code);
|
||||
}
|
||||
setAuthPhone('');
|
||||
setAuthCountry(newCountry);
|
||||
const rule = getCountryRuleByName(newCountry);
|
||||
if (rule) {
|
||||
setAuthDialCode(rule.code);
|
||||
setAuthPhone(cleanPhoneInput(authPhone, rule.maxLength, false));
|
||||
}
|
||||
}}
|
||||
className="w-full bg-slate-950 border border-slate-800 rounded-xl px-4 py-2.5 text-sm font-semibold text-white focus:outline-none focus:border-indigo-500 appearance-none"
|
||||
|
|
|
|||
Loading…
Reference in New Issue