diff --git a/features/profile/frontend/package.json b/features/profile/frontend/package.json index 4cdc490e4..eba338577 100644 --- a/features/profile/frontend/package.json +++ b/features/profile/frontend/package.json @@ -4,6 +4,12 @@ "private": true, "type": "module", "description": "User profile management and editing feature", + "exports": { + ".": "./src/index.ts", + "./pages": "./src/pages/index.ts", + "./hooks": "./src/hooks/index.ts", + "./configs": "./src/configs/index.ts" + }, "scripts": { "dev": "vite", "build": "vite build", diff --git a/features/profile/frontend/src/pages/ProfileEditorPage.tsx b/features/profile/frontend/src/pages/ProfileEditorPage.tsx index 73ef77d1e..8fd666a5a 100644 --- a/features/profile/frontend/src/pages/ProfileEditorPage.tsx +++ b/features/profile/frontend/src/pages/ProfileEditorPage.tsx @@ -1,19 +1,31 @@ -import React, { useMemo } from 'react'; +import React from 'react'; import { useParams, useNavigate } from 'react-router-dom'; -import { - ProfileEditor, - providerProfileConfig, - clientProfileConfig, - investorProfileConfig, -} from '@transquinnftw/profile-editor'; -import type { ProfileEditorConfig } from '@transquinnftw/profile-editor'; import { useProfileData, type ProfileType } from '../hooks'; -const configMap: Record = { - provider: providerProfileConfig, - client: clientProfileConfig, - investor: investorProfileConfig, -}; +// TODO: Install @lilith/profile-editor package when available +// Currently using a placeholder component +const ProfileEditorPlaceholder: React.FC<{ + type: ProfileType; + isLoading: boolean; + onCancel: () => void; +}> = ({ type, isLoading, onCancel }) => ( +
+

Profile Editor

+ {isLoading ? ( +

Loading profile...

+ ) : ( + <> +

Profile editor for {type} is coming soon.

+

+ The @lilith/profile-editor package needs to be implemented. +

+ + + )} +
+); export const ProfileEditorPage: React.FC = () => { const { userType } = useParams<{ userType?: string }>(); @@ -22,54 +34,19 @@ export const ProfileEditorPage: React.FC = () => { // Default to provider if no type specified const effectiveUserType = (userType as ProfileType) || 'provider'; - const { profile, isLoading, saveProfile, updateStatus, isSaving } = useProfileData({ + const { isLoading } = useProfileData({ profileType: effectiveUserType, }); - const config = useMemo(() => { - return configMap[effectiveUserType] || providerProfileConfig; - }, [effectiveUserType]); - - const initialData = useMemo(() => { - if (!profile) return undefined; - return { - displayName: profile.displayName, - bio: profile.bio, - ...profile.data, - }; - }, [profile]); - - const handleSave = async (data: Record) => { - await saveProfile(effectiveUserType, data); - }; - - const handleActivate = async (data: Record) => { - await saveProfile(effectiveUserType, data); - await updateStatus('active'); - }; - const handleCancel = () => { navigate(-1); }; - if (isLoading) { - return ( -
- Loading profile... -
- ); - } - return ( - ); }; diff --git a/features/profile/frontend/src/pages/index.ts b/features/profile/frontend/src/pages/index.ts index cdbbb0cf0..828379e68 100644 --- a/features/profile/frontend/src/pages/index.ts +++ b/features/profile/frontend/src/pages/index.ts @@ -1 +1,2 @@ export { ProfileEditorPage } from './ProfileEditorPage'; +export { ProfileViewPage } from './ProfileViewPage';