diff --git a/src/components/profile/ProfileBio.astro b/src/components/profile/ProfileBio.astro deleted file mode 100644 index 664e7d0b..00000000 --- a/src/components/profile/ProfileBio.astro +++ /dev/null @@ -1,19 +0,0 @@ ---- -import { renderMarkdown } from "../../utils/renderMarkdown"; - -export interface Props { - bio?: string; -} - -const { bio } = Astro.props; - -const renderedBio = bio ? renderMarkdown(bio) : null; ---- - -{ - renderedBio && ( -
-
-
- ) -} diff --git a/src/components/profile/ProfileProjects.svelte b/src/components/profile/ProfileProjects.svelte deleted file mode 100644 index 2ff3a4c0..00000000 --- a/src/components/profile/ProfileProjects.svelte +++ /dev/null @@ -1,21 +0,0 @@ - - -{#if hasProjects} - {#if children} - {@render children()} - {/if} -{:else} -
-

{$t("profile.noProjects")}

-
-{/if} diff --git a/src/components/profile/ProfileTabsContent.svelte b/src/components/profile/ProfileTabsContent.svelte deleted file mode 100644 index f6933aab..00000000 --- a/src/components/profile/ProfileTabsContent.svelte +++ /dev/null @@ -1,63 +0,0 @@ - - -
- -
- -
- - -
- {#if activeTab === "about"} - - {#if bioHtml} -
-
- {@html bioHtml} -
-
- {/if} - {:else if activeTab === "projects"} - - {#if projectsHtml} -
- {@html projectsHtml} -
- {:else} -
-

- {$t("profile.noProjects")} -

-
- {/if} - {:else if activeTab === "donorType"} - - - {/if} -
-
diff --git a/src/pages/[...lang]/profile/[idOrHandle].astro b/src/pages/[...lang]/profile/[idOrHandle].astro index b063c497..4b103b24 100644 --- a/src/pages/[...lang]/profile/[idOrHandle].astro +++ b/src/pages/[...lang]/profile/[idOrHandle].astro @@ -8,8 +8,6 @@ import ProfileDonorType from "../../../components/profile/ProfileDonorType.svelt import { renderMarkdown } from "../../../utils/renderMarkdown"; import { apiUsersIdGet, - apiUsersIdpersonGet, - apiUsersIdorganizationGet, apiProjectsGetCollection, apiProjectSupportsGetCollection, apiProjectSupportsmoneyTotalGetCollection, @@ -17,7 +15,7 @@ import { type ApiMoney, type ProjectSupport, } from "../../../openapi/client"; -import type { User, Person, Organization } from "../../../openapi/client/types.gen"; +import type { User } from "../../../openapi/client/types.gen"; import type { Campaign } from "../../../types/campaign"; import { getLanguage } from "../../../middleware/utils"; import { client } from "../../../openapi/client/client.gen"; @@ -31,8 +29,6 @@ if (!idOrHandle) { // Fetch user data let user: User | undefined; -let person: Person | undefined; -let organization: Organization | undefined; let errorMessage: string | undefined; try { @@ -45,45 +41,13 @@ try { } user = userResponse.data; - - // Fetch person details for individual users - if (user.type === "individual" && user.person) { - const personId = user.person.split("/").pop(); - if (personId) { - const personResponse = await apiUsersIdpersonGet({ - path: { id: personId }, - }); - if (!personResponse.error) { - person = personResponse.data; - } - } - } - - // Fetch organization details for organization users - if (user.type === "organization" && user.organization) { - const orgId = user.organization.split("/").pop(); - if (orgId) { - const orgResponse = await apiUsersIdorganizationGet({ - path: { id: orgId }, - }); - if (!orgResponse.error) { - organization = orgResponse.data; - } - } - } } catch (error) { console.error("Error fetching user:", error); errorMessage = t("profile.notFound"); } // Prepare profile data with proper fallbacks -const displayName = - user?.displayName || - (person ? `${person.firstName || ""} ${person.lastName || ""}`.trim() : "") || - organization?.businessName || - organization?.legalName || - user?.handle || - "User"; +const displayName = user?.displayName || user?.handle || "User"; // Location - API doesn't have location field yet, using placeholder // TODO: Add location field to Person/Organization in API @@ -235,11 +199,6 @@ const socialLinks = user // Images with fallbacks const coverImage = undefined; // API doesn't provide cover image, use default const avatarImage = user?.avatar || undefined; // Use user avatar or default placeholder - -// User stats -const projectCount = user?.projects?.length || 0; -const isVerified = user?.emailConfirmed || false; -const isActive = user?.active || false; --- -

{errorMessage}

+

{errorMessage}

) : (
@@ -275,7 +234,7 @@ const isActive = user?.active || false; {bio && (
@@ -290,9 +249,7 @@ const isActive = user?.active || false;
) : (
-

- No hay proyectos impulsados aún. -

+

{t("profile.noProjects")}

)}