account, schduels, timezone profile and many imporant updates

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-19 15:37:03 +00:00
parent 618ed8b8c6
commit e7219a2390
28 changed files with 919 additions and 358 deletions

View File

@@ -19,6 +19,7 @@ import Input from '../form/input/InputField';
import Checkbox from '../form/input/Checkbox';
import Button from '../ui/button/Button';
import { useAuthStore } from '../../store/authStore';
import { fetchCountries } from '../../utils/countries';
interface Plan {
id: number;
@@ -102,23 +103,8 @@ export default function SignUpFormUnified({
const loadCountriesAndDetect = async () => {
setCountriesLoading(true);
try {
const API_BASE_URL = import.meta.env.VITE_BACKEND_URL || 'https://api.igny8.com/api';
const response = await fetch(`${API_BASE_URL}/v1/auth/countries/`);
if (response.ok) {
const data = await response.json();
setCountries(data.countries || []);
} else {
// Fallback countries if backend fails
setCountries([
{ code: 'US', name: 'United States' },
{ code: 'GB', name: 'United Kingdom' },
{ code: 'CA', name: 'Canada' },
{ code: 'AU', name: 'Australia' },
{ code: 'PK', name: 'Pakistan' },
{ code: 'IN', name: 'India' },
]);
}
const loadedCountries = await fetchCountries();
setCountries(loadedCountries);
// Try to detect user's country for default selection
// Note: This may fail due to CORS - that's expected and handled gracefully
@@ -137,17 +123,6 @@ export default function SignUpFormUnified({
// 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);
// Fallback countries
setCountries([
{ code: 'US', name: 'United States' },
{ code: 'GB', name: 'United Kingdom' },
{ code: 'CA', name: 'Canada' },
{ code: 'AU', name: 'Australia' },
{ code: 'PK', name: 'Pakistan' },
{ code: 'IN', name: 'India' },
]);
} finally {
setCountriesLoading(false);
}