diff --git a/modules/portfolio/component/awards-modal.tsx b/modules/portfolio/component/awards-modal.tsx index bde95cef5..8a56c00dc 100644 --- a/modules/portfolio/component/awards-modal.tsx +++ b/modules/portfolio/component/awards-modal.tsx @@ -616,13 +616,13 @@ const AwardItem: React.FC = ({ award }) => { onClick={openEditForm} className="border-none outline-none text-[#5B8DEF] bg-transparent hover:bg-zinc-100 focus:bg-zinc-200 active:bg-zinc-100 duration-300" > - + {' '} diff --git a/modules/portfolio/component/education-modal.tsx b/modules/portfolio/component/education-modal.tsx index a109b31e1..2a8eb5028 100644 --- a/modules/portfolio/component/education-modal.tsx +++ b/modules/portfolio/component/education-modal.tsx @@ -131,13 +131,13 @@ const EducationSection: React.FC = ({ isOpen, onCloseModal, setIsData(false); }} > - + handleDeleteEducation(education.id, e)} > - + @@ -178,7 +178,7 @@ const EducationSection: React.FC = ({ isOpen, onCloseModal, className="font-semibold cursor-pointer text-brand-red-hover" onClick={(e) => handleDeleteEducation(editingEducation?.id, e)} > - + diff --git a/modules/portfolio/component/landing/landing-page.tsx b/modules/portfolio/component/landing/landing-page.tsx index 2c5b76ad6..8ff3ff02d 100644 --- a/modules/portfolio/component/landing/landing-page.tsx +++ b/modules/portfolio/component/landing/landing-page.tsx @@ -1,6 +1,6 @@ 'use-client'; import Image from 'next/image'; -import React, { useContext, useEffect } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import LandinEmptyState from './landingpage-empty'; import LandingPageFilled from './landingpage-filled'; import Cover from './cover-avatar'; @@ -14,6 +14,23 @@ import { Edit2 } from 'iconsax-react'; import Link from 'next/link'; import EditCover from './editCover-takeAssessment'; +// const fetchBadgeData = async () => { +// try { +// const response = await fetch('https://hng6-r5y3.onrender.com/api/v1/users/e2009b92-8acf-406d-a974-95fb6a5215f3'); +// if (response.ok) { +// const data = await response.json(); +// return data.data.badges[0]; // Assuming there's only one badge +// } else { +// console.error('Failed to fetch badge data'); +// return null; +// } +// } catch (error) { +// console.error('Error fetching badge data:', error); +// return null; +// } +// }; + + const Landing = () => { const { profileUpdate, @@ -29,6 +46,7 @@ const Landing = () => { } = useContext(Portfolio); const { firstName, lastName, tracks, city, country, coverImage } = userData; + // const [badgeData, setBadgeData] = useState<{ name: string; badge_image: string } | null>(null); useEffect(() => { if (!getUserSections.isLoading && getUserSections.data) { @@ -46,6 +64,14 @@ const Landing = () => { ) : ( ); + + // useEffect(() => { + // fetchBadgeData().then((data) => { + // setBadgeData(data); + // }); + // }, []); + + return ( <>
@@ -84,6 +110,12 @@ const Landing = () => { {city ? city : ``} {`${city && country ? ',' : ''}`} {country ? country : ''}

+ {/* {badgeData && ( +
+

Badge Name: {badgeData.name}

+ Badge +
+ )} */}
- + handleDelete(id)}> - + diff --git a/modules/portfolio/component/work-experience-modal.tsx b/modules/portfolio/component/work-experience-modal.tsx index 85f112b19..f78ced965 100644 --- a/modules/portfolio/component/work-experience-modal.tsx +++ b/modules/portfolio/component/work-experience-modal.tsx @@ -154,13 +154,13 @@ const WorkExperienceModalSection: React.FC = ({ isOpen setIsData(false); }} > - + handleDeleteExperience(experience.id, e)} > - + diff --git a/pages/portfolio/slug.tsx b/pages/portfolio/slug.tsx new file mode 100644 index 000000000..e69de29bb