last signup fix

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-17 06:46:16 +00:00
parent 491ddc5fbb
commit 79398c908d
6 changed files with 672 additions and 1238 deletions

View File

@@ -121,9 +121,11 @@ export default function SignUpFormUnified({
}
// Try to detect user's country for default selection
// Note: This may fail due to CORS - that's expected and handled gracefully
try {
const geoResponse = await fetch('https://ipapi.co/country_code/', {
signal: AbortSignal.timeout(3000),
mode: 'cors',
});
if (geoResponse.ok) {
const countryCode = await geoResponse.text();
@@ -131,8 +133,9 @@ export default function SignUpFormUnified({
setFormData(prev => ({ ...prev, billingCountry: countryCode.trim() }));
}
}
} catch {
// Silently fail - keep default US
} catch (error) {
// Silently fail - CORS or network error, keep default US
// This is expected behavior and not a critical error
}
} catch (err) {
console.error('Failed to load countries:', err);
@@ -283,28 +286,24 @@ export default function SignUpFormUnified({
billingPeriod === 'monthly' ? 'translate-x-0' : 'translate-x-28'
}`}
></span>
<Button
variant="ghost"
tone="neutral"
size="sm"
<button
type="button"
onClick={() => setBillingPeriod('monthly')}
className={`relative flex h-9 w-28 items-center justify-center text-sm font-semibold transition-all duration-200 rounded-md ${
billingPeriod === 'monthly' ? 'text-white' : 'text-gray-600 dark:text-gray-400 hover:text-gray-800 hover:bg-gray-100 dark:hover:text-gray-200 dark:hover:bg-gray-700'
billingPeriod === 'monthly' ? 'text-white' : 'text-gray-600 dark:text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white'
}`}
>
Monthly
</Button>
<Button
variant="ghost"
tone="neutral"
size="sm"
</button>
<button
type="button"
onClick={() => setBillingPeriod('annually')}
className={`relative flex h-9 w-28 items-center justify-center text-sm font-semibold transition-all duration-200 rounded-md ${
billingPeriod === 'annually' ? 'text-white' : 'text-gray-600 dark:text-gray-400 hover:text-gray-800 hover:bg-gray-100 dark:hover:text-gray-200 dark:hover:bg-gray-700'
billingPeriod === 'annually' ? 'text-white' : 'text-gray-600 dark:text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white'
}`}
>
Annually
</Button>
</button>
</div>
<span className={`inline-flex items-center gap-1.5 text-xs text-success-600 dark:text-success-400 font-semibold bg-success-50 dark:bg-success-900/20 px-2 py-1 rounded-full transition-opacity duration-200 ${
billingPeriod === 'annually' ? 'opacity-100' : 'opacity-0'
@@ -437,9 +436,6 @@ export default function SignUpFormUnified({
))}
</select>
)}
<p className="mt-1 text-xs text-gray-500 dark:text-gray-400">
Your country determines available payment methods
</p>
</div>
<div className="flex items-start gap-3 pt-2">
@@ -496,28 +492,24 @@ export default function SignUpFormUnified({
billingPeriod === 'monthly' ? 'translate-x-0' : 'translate-x-32'
}`}
></span>
<Button
variant="ghost"
tone="neutral"
size="sm"
<button
type="button"
onClick={() => setBillingPeriod('monthly')}
className={`relative flex h-11 w-32 items-center justify-center text-base font-semibold transition-all duration-200 rounded-lg ${
billingPeriod === 'monthly' ? 'text-white' : 'text-gray-600 dark:text-gray-400 hover:text-gray-800 hover:bg-gray-100 dark:hover:text-gray-200 dark:hover:bg-gray-700'
billingPeriod === 'monthly' ? 'text-white' : 'text-gray-600 dark:text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white'
}`}
>
Monthly
</Button>
<Button
variant="ghost"
tone="neutral"
size="sm"
</button>
<button
type="button"
onClick={() => setBillingPeriod('annually')}
className={`relative flex h-11 w-32 items-center justify-center text-base font-semibold transition-all duration-200 rounded-lg ${
billingPeriod === 'annually' ? 'text-white' : 'text-gray-600 dark:text-gray-400 hover:text-gray-800 hover:bg-gray-100 dark:hover:text-gray-200 dark:hover:bg-gray-700'
billingPeriod === 'annually' ? 'text-white' : 'text-gray-600 dark:text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white'
}`}
>
Annually
</Button>
</button>
</div>
<p className={`inline-flex items-center gap-1.5 text-success-600 dark:text-success-400 text-sm font-semibold bg-success-50 dark:bg-success-900/20 px-3 py-1.5 rounded-full transition-opacity duration-200 ${
billingPeriod === 'annually' ? 'opacity-100' : 'opacity-0'