Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z16/feat/portfolio profile modal #1443

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/portfolio/component/awards-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -616,13 +616,13 @@ const AwardItem: React.FC<AwardItemProps> = ({ 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"
>
<Edit2 size="24" color="#37d67a" variant="Outline" />
<Edit2 size="20" color="#37d67a" variant="Outline" />
</Button>{' '}
<Button
onClick={handleDelete}
className="border-none outline-none text-brand-red-hover bg-transparent hover:bg-zinc-100 focus:bg-zinc-200 active:bg-zinc-100 duration-300"
>
<Trash size="24" color="#f47373" variant="Outline" />
<Trash size="20" color="#f47373" variant="Outline" />
</Button>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions modules/portfolio/component/education-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ const EducationSection: React.FC<EducationModalProps> = ({ isOpen, onCloseModal,
setIsData(false);
}}
>
<Edit2 size="24" color="#37d67a" variant="Outline" />
<Edit2 size="20" color="#37d67a" variant="Outline" />
</span>
<span
className="font-semibold cursor-pointer"
onClick={(e) => handleDeleteEducation(education.id, e)}
>
<Trash size="24" color="#f47373" variant="Outline" />
<Trash size="20" color="#f47373" variant="Outline" />
</span>
</div>
</article>
Expand Down Expand Up @@ -178,7 +178,7 @@ const EducationSection: React.FC<EducationModalProps> = ({ isOpen, onCloseModal,
className="font-semibold cursor-pointer text-brand-red-hover"
onClick={(e) => handleDeleteEducation(editingEducation?.id, e)}
>
<Trash size="32" color="#f47373" variant="Outline" />
<Trash size="20" color="#f47373" variant="Outline" />
</span>
</div>
</article>
Expand Down
34 changes: 33 additions & 1 deletion modules/portfolio/component/landing/landing-page.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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,
Expand All @@ -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) {
Expand All @@ -46,6 +64,14 @@ const Landing = () => {
) : (
<CoverDiv className={`bg-[#F0F1F0] opacity-80 ${headerMargin}`} />
);

// useEffect(() => {
// fetchBadgeData().then((data) => {
// setBadgeData(data);
// });
// }, []);


return (
<>
<div>
Expand Down Expand Up @@ -84,6 +110,12 @@ const Landing = () => {
{city ? city : ``}
{`${city && country ? ',' : ''}`} {country ? country : ''}
</p>
{/* {badgeData && (
<div>
<p>Badge Name: {badgeData.name}</p>
<Image src={badgeData.badge_image} alt="Badge" />
</div>
)} */}
</div>
</div>
<span
Expand Down
2 changes: 1 addition & 1 deletion modules/portfolio/component/modals/edit-profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { StaticImport } from 'next/dist/shared/lib/get-img-props';
import Modal from '@ui/Modal';
import Loader from '@ui/Loader';
import CountryCityDropdown from './CountryCityDropdown';

// import Badges from './badges';
import { useAuth } from '../../../../context/AuthContext';

const inputStyle = `placeholder-gray-300 placeholder-opacity-40 font-semibold text-gray-500 h-[50px] border-2 border-[#bcbcbc] rounded-[10px] px-4 ring-0 outline-brand-green-primary transition-all duration-300 ease-in-out select-none focus-within:border-brand-green-primary`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ const AllProjectsModal = ({
handleSetRoute('add-project');
}}
>
<Edit2 size="24" color="#37d67a" variant="Outline" />
<Edit2 size="20" color="#37d67a" variant="Outline" />
</span>
<span className="text-[#FF5C5C] cursor-pointer font-manropeL" onClick={() => handleDelete(id)}>
<Trash size="24" color="#f47373" variant="Outline" />
<Trash size="20" color="#f47373" variant="Outline" />
</span>
</section>

Expand Down
4 changes: 2 additions & 2 deletions modules/portfolio/component/work-experience-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ const WorkExperienceModalSection: React.FC<WorkExperienceModalProps> = ({ isOpen
setIsData(false);
}}
>
<Edit2 size="24" color="#37d67a" variant="Outline" />
<Edit2 size="20" color="#37d67a" variant="Outline" />
</span>
<span
className="font-semibold cursor-pointer"
onClick={(e) => handleDeleteExperience(experience.id, e)}
>
<Trash size="24" color="#f47373" variant="Outline" />
<Trash size="20" color="#f47373" variant="Outline" />
</span>
</div>
</article>
Expand Down
Empty file added pages/portfolio/slug.tsx
Empty file.
Loading