diff --git a/app/profile/[id]/page.tsx b/app/profile/[id]/page.tsx index a7c49a6..ee12eee 100644 --- a/app/profile/[id]/page.tsx +++ b/app/profile/[id]/page.tsx @@ -7,19 +7,18 @@ import { BsInstagram } from "react-icons/bs"; import { CiTwitter } from "react-icons/ci"; import { TfiWorld } from "react-icons/tfi"; import { TiStarOutline } from "react-icons/ti"; +import freelancerProfiles from "@/mockup/freelancerProfilesMockup"; +import { findFreelancerProfile } from "@/lib/utils"; - - - -// static template, waiting for next mockup feature... i feel bad for the "a propos double paragraphes mapping logic" -export default function FreelancerPage() { +export default async function FreelancerPage({ params }: { params: { id: string } }) { + const profile: Mockup.IFreelancerProfile | null = await findFreelancerProfile(freelancerProfiles, params.id); return ( -
+
Picture of the freelancer
-

Jerome Bell

-

Product Designer

+

{profile?.firstName} {profile?.lastName}

+

{profile?.role}

- 4.0 + {profile?.profileRating}
@@ -41,15 +40,15 @@ export default function FreelancerPage() { Emplois postulés

- il y a 2 jours + {profile?.lastEmploymentString}

- Product Development + {profile?.freelancerDomain}

-

Marketing • Plein Temps

+

{profile?.freelancerExpertise} • {profile?.timeEmployment}

@@ -68,7 +67,7 @@ export default function FreelancerPage() {

Email

- jeromeBell45@email.com + {profile?.email}
@@ -79,7 +78,7 @@ export default function FreelancerPage() {

Phone

- +44 1245 572 135 + {profile?.phone}
@@ -90,7 +89,7 @@ export default function FreelancerPage() {

Instagram

- instagram.com/jeromebell + {profile?.instagram}
@@ -101,7 +100,7 @@ export default function FreelancerPage() {

Twitter

- twitter.com/jeromebell + {profile?.twitter}
@@ -112,7 +111,7 @@ export default function FreelancerPage() {

Siteweb

- www.jeromebell.com + {profile?.website}
@@ -133,7 +132,7 @@ export default function FreelancerPage() { -
+

Profile d'applicant

@@ -147,25 +146,24 @@ export default function FreelancerPage() {

Nom complet

-

Jerome Bell

+

{profile?.firstName} {profile?.lastName}

-

Date de naissance

-

March 23, 1995 (26 y.o)

+

{profile?.birthDate}

Address

-

4517 Washington Ave. Manchester, Kentucky 39495

+

{profile?.address}

Sex

-

Homme

+

{profile?.gender}

Language

-

English, French

+

{profile?.languages}

@@ -181,8 +179,7 @@ export default function FreelancerPage() {

à propos

-

I'm a product designer + filmmaker currently working remotely at Twitter from beautiful Manchester, United Kingdom. I'm passionate about designing digital products that have a positive impact on the world

-

For 10 years, I've specialised in interface, experience & interaction design as well as working in user research and product strategy for product agencies, big tech companies & start-ups.

+

{profile?.description}

@@ -190,24 +187,26 @@ export default function FreelancerPage() {

Actuellement

-

Product Designer

+

{profile?.role}

Plus haute qualification obtenue

-

Bachelors in Engineering

+

{profile?.academicCareer}

Experience

-

4 ans

+

{profile?.experience}

Skills

-

Project Management

-

Copywriting

-

English

+ { + profile?.skills.map((skill, index) => ( +

{skill}

+ )) + }
diff --git a/components/freelancer-card.tsx b/components/freelancer-card.tsx index 9636217..1f39db1 100644 --- a/components/freelancer-card.tsx +++ b/components/freelancer-card.tsx @@ -21,16 +21,14 @@ export function FreelancerCard({ freelancer }: { freelancer: Mockup.ICard }) { alt="Picture of the freelancer" className="rounded-full" /> - + + +
diff --git a/lib/utils.ts b/lib/utils.ts index d084cca..73e4d40 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -4,3 +4,14 @@ import { twMerge } from "tailwind-merge" export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) } + +export async function findFreelancerProfile(L: Array, x: string): Promise { + return new Promise((resolve, reject) => { + const existingProfile = L.find((e) => e.id === x); + if (existingProfile) { + resolve(existingProfile); + } else { + reject(null); + } + }) +} \ No newline at end of file diff --git a/mockup/freelancerPageMockup.ts b/mockup/freelancerPageMockup.ts index 65b9e23..366ce4e 100644 --- a/mockup/freelancerPageMockup.ts +++ b/mockup/freelancerPageMockup.ts @@ -49,4 +49,4 @@ const freelancerCards : Array = [ } ] -export default freelancerCards \ No newline at end of file +export default freelancerCards; \ No newline at end of file diff --git a/mockup/freelancerProfilesMockup.ts b/mockup/freelancerProfilesMockup.ts new file mode 100644 index 0000000..889118a --- /dev/null +++ b/mockup/freelancerProfilesMockup.ts @@ -0,0 +1,161 @@ +const freelancerProfiles: Array = [ + { + id: "1", + firstName: "Aymen", + lastName: "Ben Ali", + profileRating: 4.5, + role: "Software Engineer", + profilePicture: "/profilePictures/m1.jpg", + description: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Aut quis nobis reiciendis tempore ullam, reprehenderit, officiis natus dignissimos aliquid facere deleniti in a odio ea voluptate harum dolorum. Earum, repellat error. Voluptatum hic, eveniet, odio omnis rerum repudiandae voluptates nobis reprehenderit, totam consectetur rem fuga. Quaerat dolorem aperiam molestiae facilis in. Consequatur magni harum quod vel molestiae nemo impedit sunt alias ad animi eos quisquam mollitia voluptatum recusandae, adipisci et cumque minima nesciunt natus repellat asperiores explicabo fugit voluptate. Quod repellendus voluptatum impedit asperiores unde quisquam adipisci esse tempore facere", + lastEmploymentString: "il ya 2 jours", + freelancerDomain: "Product Development", + freelancerExpertise: "marketing", + timeEmployment: "Plein temps", + email: "jeromeBell45@email.com", + phone: "+44 1245 572 135", + instagram: "instagram.com/jeromebell", + twitter: "twitter.com/jeromebell", + website: "www.jeromebell.com", + gender: "male", + birthDate: "March 23, 1995 (26 y.o)", + birthPlace: "Tunis, Tunisia", + languages: "English, French", + address: "4517 Washington Ave. Manchester, Kentucky 39495", + experience: "4 ans", + academicCareer: "Bachelors in Engineering", + skills: ["Project Management", "Copywriting", "English"] + }, + { + id: "2", + firstName: "Fatma", + lastName: "Trabelsi", + profileRating: 4.7, + role: "Data Scientist", + profilePicture: "/profilePictures/f1.jpg", + description: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Aut quis nobis reiciendis tempore ullam, reprehenderit, officiis natus dignissimos aliquid facere deleniti in a odio ea voluptate harum dolorum. Earum, repellat error. Voluptatum hic, eveniet, odio omnis rerum repudiandae voluptates nobis reprehenderit, totam consectetur rem fuga. Quaerat dolorem aperiam molestiae facilis in. Consequatur magni harum quod vel molestiae nemo impedit sunt alias ad animi eos quisquam mollitia voluptatum recusandae, adipisci et cumque minima nesciunt natus repellat asperiores explicabo fugit voluptate. Quod repellendus voluptatum impedit asperiores unde quisquam adipisci esse tempore facere", + lastEmploymentString: "il y a 1 mois", + freelancerDomain: "Data Analytics", + freelancerExpertise: "data visualization", + timeEmployment: "Temps partiel", + email: "fatma.trabelsi@email.com", + phone: "+33 123 456 789", + instagram: "instagram.com/fatma_trabelsi", + twitter: "twitter.com/fatma_trabelsi", + website: "www.fatmatrabelsi.com", + gender: "female", + birthDate: "June 15, 1992 (32 y.o)", + birthPlace: "Paris, France", + languages: "English, Arabic", + address: "12 Rue de Paris, Paris, France", + experience: "6 ans", + academicCareer: "Masters in Data Science", + skills: ["Data Analysis", "Python", "SQL"] + }, + { + id: "3", + firstName: "Mohamed", + lastName: "Hammami", + profileRating: 4.6, + role: "Machine Learning Engineer", + profilePicture: "/profilePictures/m2.jpg", + description: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Aut quis nobis reiciendis tempore ullam, reprehenderit, officiis natus dignissimos aliquid facere deleniti in a odio ea voluptate harum dolorum. Earum, repellat error. Voluptatum hic, eveniet, odio omnis rerum repudiandae voluptates nobis reprehenderit, totam consectetur rem fuga. Quaerat dolorem aperiam molestiae facilis in. Consequatur magni harum quod vel molestiae nemo impedit sunt alias ad animi eos quisquam mollitia voluptatum recusandae, adipisci et cumque minima nesciunt natus repellat asperiores explicabo fugit voluptate. Quod repellendus voluptatum impedit asperiores unde quisquam adipisci esse tempore facere", + lastEmploymentString: "il y a 3 semaines", + freelancerDomain: "AI & ML", + freelancerExpertise: "deep learning", + timeEmployment: "Plein temps", + email: "mohamed.hammami@email.com", + phone: "+216 50 123 456", + instagram: "instagram.com/mohamed_hammami", + twitter: "twitter.com/mohamed_hammami", + website: "www.mohamedhammami.com", + gender: "male", + birthDate: "October 5, 1989 (34 y.o)", + birthPlace: "Tunis, Tunisia", + languages: "English, Arabic", + address: "4 Rue de Tunis, Tunis, Tunisia", + experience: "8 ans", + academicCareer: "PhD in Machine Learning", + skills: ["TensorFlow", "Keras", "Neural Networks"] + }, + { + id: "4", + firstName: "Salma", + lastName: "Khaled", + profileRating: 4.8, + role: "AI Researcher", + profilePicture: "/profilePictures/f2.jpg", + description: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Aut quis nobis reiciendis tempore ullam, reprehenderit, officiis natus dignissimos aliquid facere deleniti in a odio ea voluptate harum dolorum. Earum, repellat error. Voluptatum hic, eveniet, odio omnis rerum repudiandae voluptates nobis reprehenderit, totam consectetur rem fuga. Quaerat dolorem aperiam molestiae facilis in. Consequatur magni harum quod vel molestiae nemo impedit sunt alias ad animi eos quisquam mollitia voluptatum recusandae, adipisci et cumque minima nesciunt natus repellat asperiores explicabo fugit voluptate. Quod repellendus voluptatum impedit asperiores unde quisquam adipisci esse tempore facere", + lastEmploymentString: "il y a 2 semaines", + freelancerDomain: "AI Research", + freelancerExpertise: "natural language processing", + timeEmployment: "Plein temps", + email: "salma.khaled@email.com", + phone: "+20 123 456 789", + instagram: "instagram.com/salma_khaled", + twitter: "twitter.com/salma_khaled", + website: "www.salmakhaled.com", + gender: "female", + birthDate: "April 22, 1987 (37 y.o)", + birthPlace: "Marseille, France", + languages: "English, Arabic", + address: "24 Boulevard Longchamp, Marseille, France", + experience: "10 ans", + academicCareer: "Masters in Artificial Intelligence", + skills: ["NLP", "Python", "Research"] + }, + { + id: "5", + firstName: "Nour", + lastName: "Maaloul", + profileRating: 4.4, + role: "DevOps Engineer", + profilePicture: "/profilePictures/f3.jpg", + description: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Aut quis nobis reiciendis tempore ullam, reprehenderit, officiis natus dignissimos aliquid facere deleniti in a odio ea voluptate harum dolorum. Earum, repellat error. Voluptatum hic, eveniet, odio omnis rerum repudiandae voluptates nobis reprehenderit, totam consectetur rem fuga. Quaerat dolorem aperiam molestiae facilis in. Consequatur magni harum quod vel molestiae nemo impedit sunt alias ad animi eos quisquam mollitia voluptatum recusandae, adipisci et cumque minima nesciunt natus repellat asperiores explicabo fugit voluptate. Quod repellendus voluptatum impedit asperiores unde quisquam adipisci esse tempore facere", + lastEmploymentString: "il y a 1 mois", + freelancerDomain: "DevOps", + freelancerExpertise: "cloud infrastructure", + timeEmployment: "Plein temps", + email: "nour.maaloul@email.com", + phone: "+961 71 234 567", + instagram: "instagram.com/nour_maaloul", + twitter: "twitter.com/nour_maaloul", + website: "www.nourmaaloul.com", + gender: "female", + birthDate: "August 12, 1990 (33 y.o)", + birthPlace: "Tunis, Tunisia", + languages: "English, Arabic", + address: "8 Rue de Beirut, Beirut, Lebanon", + experience: "5 ans", + academicCareer: "Bachelors in Computer Science", + skills: ["AWS", "Docker", "CI/CD"] + }, + { + id: "6", + firstName: "Rania", + lastName: "Bouzid", + profileRating: 4.3, + role: "Frontend Developer", + profilePicture: "/profilePictures/f4.jpg", + description: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Aut quis nobis reiciendis tempore ullam, reprehenderit, officiis natus dignissimos aliquid facere deleniti in a odio ea voluptate harum dolorum. Earum, repellat error. Voluptatum hic, eveniet, odio omnis rerum repudiandae voluptates nobis reprehenderit, totam consectetur rem fuga. Quaerat dolorem aperiam molestiae facilis in. Consequatur magni harum quod vel molestiae nemo impedit sunt alias ad animi eos quisquam mollitia voluptatum recusandae, adipisci et cumque minima nesciunt natus repellat asperiores explicabo fugit voluptate. Quod repellendus voluptatum impedit asperiores unde quisquam adipisci esse tempore facere", + lastEmploymentString: "il y a 2 jours", + freelancerDomain: "Web Development", + freelancerExpertise: "React.js", + timeEmployment: "Plein temps", + email: "rania.bouzid@email.com", + phone: "+216 70 123 456", + instagram: "instagram.com/rania_bouzid", + twitter: "twitter.com/rania_bouzid", + website: "www.raniabouzid.com", + gender: "female", + birthDate: "January 29, 1994 (30 y.o)", + birthPlace: "Lille, France", + languages: "English, French", + address: "10 Rue de Lille, Lille, France", + experience: "3 ans", + academicCareer: "Bachelors in Web Development", + skills: ["React.js", "CSS", "JavaScript"] + } +]; + + +export default freelancerProfiles; \ No newline at end of file diff --git a/typos/global.d.ts b/typos/global.d.ts index 259a8cc..9522b99 100644 --- a/typos/global.d.ts +++ b/typos/global.d.ts @@ -7,4 +7,25 @@ namespace Mockup { role: string, profilePicture: string } -} \ No newline at end of file + + interface IFreelancerProfile extends ICard { + profileRating: number, + lastEmploymentString: string, + freelancerDomain: string, + freelancerExpertise: string, + timeEmployment: string, + email: string, + phone: string, + instagram: string, + twitter: string, + website: string, + gender: string, + birthDate: string, + birthPlace: string, + languages: string, + address: string, + experience: string, + academicCareer: string, + skills: Array + } +}; \ No newline at end of file