di usage in website
This commit is contained in:
@@ -7,7 +7,9 @@ import Button from '@/components/ui/Button';
|
||||
import Card from '@/components/ui/Card';
|
||||
import Heading from '@/components/ui/Heading';
|
||||
import { useEffectiveDriverId } from '@/hooks/useEffectiveDriverId';
|
||||
import { useServices } from '@/lib/services/ServiceProvider';
|
||||
import { useDriverProfile } from '@/hooks/driver/useDriverProfile';
|
||||
import { useInject } from '@/lib/di/hooks/useInject';
|
||||
import { DRIVER_SERVICE_TOKEN, MEDIA_SERVICE_TOKEN } from '@/lib/di/tokens';
|
||||
import type {
|
||||
DriverProfileAchievementViewModel,
|
||||
DriverProfileSocialHandleViewModel,
|
||||
@@ -16,9 +18,7 @@ import type {
|
||||
import { getMediaUrl } from '@/lib/utilities/media';
|
||||
|
||||
// Shared state components
|
||||
import { useDataFetching } from '@/components/shared/hooks/useDataFetching';
|
||||
import { StateContainer } from '@/components/shared/state/StateContainer';
|
||||
import { LoadingWrapper } from '@/components/shared/state/LoadingWrapper';
|
||||
import {
|
||||
Activity,
|
||||
Award,
|
||||
@@ -263,17 +263,14 @@ export default function ProfilePage() {
|
||||
const searchParams = useSearchParams();
|
||||
const tabParam = searchParams.get('tab') as ProfileTab | null;
|
||||
|
||||
const { driverService, mediaService } = useServices();
|
||||
const driverService = useInject(DRIVER_SERVICE_TOKEN);
|
||||
const mediaService = useInject(MEDIA_SERVICE_TOKEN);
|
||||
|
||||
const effectiveDriverId = useEffectiveDriverId();
|
||||
const isOwnProfile = true; // This page is always your own profile
|
||||
|
||||
// Shared state components
|
||||
const { data: profileData, isLoading: loading, error, retry } = useDataFetching({
|
||||
queryKey: ['driverProfile', effectiveDriverId],
|
||||
queryFn: () => driverService.getDriverProfile(effectiveDriverId),
|
||||
enabled: !!effectiveDriverId,
|
||||
});
|
||||
// Use React-Query hook for profile data
|
||||
const { data: profileData, isLoading: loading, error, retry } = useDriverProfile(effectiveDriverId || '');
|
||||
|
||||
const [editMode, setEditMode] = useState(false);
|
||||
const [activeTab, setActiveTab] = useState<ProfileTab>(tabParam || 'overview');
|
||||
|
||||
Reference in New Issue
Block a user