Skip to content

Commit cfb7b96

Browse files
committed
Add JavaScript Algorithms and DS certification with updated icons and filters
1 parent b130faa commit cfb7b96

2 files changed

Lines changed: 46 additions & 57 deletions

File tree

580 KB
Loading

src/Page/OpportunitiesHub/CertificationList.jsx

Lines changed: 46 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from 'react';
22
import styled from 'styled-components';
33
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4-
import { faFlag, faMapMarkerAlt, faCalendarAlt, faShareAlt } from '@fortawesome/free-solid-svg-icons';
4+
import { faFlag, faSignal, faClock, faShareAlt } from '@fortawesome/free-solid-svg-icons';
55

66
const shareContent = (url, title, organizer) => {
77
if (navigator.share) {
@@ -22,15 +22,15 @@ const shareContent = (url, title, organizer) => {
2222

2323
const certification = [
2424
{
25-
organizer: 'Coursera',
26-
title: 'Foundations of User Experience (UX) Design',
25+
organizer: 'Freecodecamp',
26+
title: 'JavaScript Algorithms and DS',
2727
duration: '4 Weeks',
28-
level: 'Beginner',
29-
skills: ['UX', 'Design Thinking', 'Prototyping'],
30-
referralCode: 'UX-REF123',
31-
certificateLink: 'https://coursera.org/verify/ABCD1234',
32-
poster: '/assets/ux-cert.png',
33-
shareLink: '#ux-certification',
28+
level: 'Intermediate',
29+
skills: ['JavaScript', 'Algorithms', 'Data Structures'],
30+
referralCode: 'devdisplay',
31+
ApplyLink: 'https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/',
32+
poster: '/assets/Certifications/JavaScript Algorithms and DS.png',
33+
shareLink: '#javascript-algorithms-ds',
3434
},
3535
];
3636

@@ -110,30 +110,39 @@ const StyledcertificationCard = styled.div`
110110
}
111111
`;
112112

113-
const CertificationCardComponent = ({ organizer, title, location, date, domains, applyLink, poster, shareLink }) => {
113+
const CertificationCardComponent = ({
114+
organizer,
115+
title,
116+
duration,
117+
level,
118+
skills,
119+
referralCode,
120+
ApplyLink,
121+
poster,
122+
shareLink,
123+
}) => {
114124
return (
115125
<StyledcertificationCard id={shareLink.substring(1)}>
116-
{/* <div className="dot"></div> */}
117126
<div className="flex items-center justify-between p-2">
118127
<span className="text-sm font-semibold text-white">
119128
<FontAwesomeIcon icon={faFlag} className="mr-1 text-[#00a6fb]" /> {organizer}
120129
</span>
121130
<a
122-
href={applyLink}
131+
href={ApplyLink}
123132
target="_blank"
124133
rel="noopener noreferrer"
125-
className="bg-gray-1000 hover:bg-gray-1000 text-semibold relative flex items-center rounded-full border border-[#00a6fb] px-2 py-1 text-gray-300"
134+
className="bg-gray-1000 hover:bg-gray-1000 text-semibold flex items-center rounded-full border border-[#00a6fb] px-2 py-1 text-gray-300"
126135
>
127-
<div className="status-user" style={{ marginRight: '8px' }} />
128-
Apply Now
136+
<div className="status-user mr-2" />
137+
Certified Now
129138
</a>
130139
</div>
131140

132141
<div className="h-50 relative w-full overflow-hidden rounded-xl p-2 shadow-md">
133142
<div className="absolute bottom-3 right-3 z-10">
134143
<button
135144
onClick={() => shareContent(window.location.href.split('#')[0] + shareLink)}
136-
className="bg-gray-1000 hover:bg-slate-1000 flex items-center justify-center gap-2 rounded-xl border border-[#00a6fb] bg-opacity-50 px-2 py-1 text-xs text-white backdrop-blur-md transition-colors"
145+
className="bg-gray-1000 hover:bg-slate-1000 flex items-center justify-center gap-2 rounded-xl border border-[#00a6fb] bg-opacity-50 px-2 py-1 text-xs text-white backdrop-blur-md"
137146
>
138147
<FontAwesomeIcon icon={faShareAlt} />
139148
Share
@@ -145,7 +154,7 @@ const CertificationCardComponent = ({ organizer, title, location, date, domains,
145154
className="h-full w-full rounded-lg object-cover"
146155
onError={(e) => {
147156
e.target.onerror = null;
148-
e.target.src = '/images/default.png';
157+
e.target.src = '/assets/Coming Soon.png';
149158
}}
150159
/>
151160
</div>
@@ -154,20 +163,19 @@ const CertificationCardComponent = ({ organizer, title, location, date, domains,
154163

155164
<div className="flex justify-between p-2 text-sm text-[#00a6fb]">
156165
<span>
157-
<FontAwesomeIcon icon={faMapMarkerAlt} className="mr-1 text-white" /> {location}
166+
<FontAwesomeIcon icon={faClock} className="mr-1 text-white" /> {duration}
158167
</span>
159168
<span>
160-
<FontAwesomeIcon icon={faCalendarAlt} className="mr-1 text-white" /> {date}
169+
<FontAwesomeIcon icon={faSignal} className="mr-1 text-white" /> {level}
161170
</span>
162171
</div>
163172

173+
<div className="mb-1 text-center text-sm text-gray-400">Referral Code: {referralCode}</div>
174+
164175
<div className="mt-2 flex flex-wrap justify-center gap-2 p-2">
165-
{domains.map((domain, idx) => (
166-
<span
167-
key={idx}
168-
className="bg-gray-1000 rounded-full border border-[#00a6fb] px-2 py-1 text-xs text-gray-300"
169-
>
170-
{domain}
176+
{skills.map((skill, idx) => (
177+
<span key={idx} className="bg-gray-1000 rounded-full border border-[#00a6fb] px-2 py-1 text-xs text-gray-300">
178+
{skill}
171179
</span>
172180
))}
173181
</div>
@@ -243,52 +251,33 @@ const FilterContainer = styled.div`
243251
`;
244252

245253
const CertificationList = () => {
246-
const [locationFilter, setLocationFilter] = useState('');
247-
const [monthFilter, setMonthFilter] = useState('');
248-
const [domainFilter, setDomainFilter] = useState('');
254+
const [skillFilter, setSkillFilter] = useState('');
255+
const [organizerFilter, setOrganizerFilter] = useState('');
249256

250257
const filteredcertification = certification.filter((certification) => {
251-
const matchesLocation = locationFilter
252-
? certification.location.toLowerCase().includes(locationFilter.toLowerCase())
253-
: true;
254-
const matchesMonth = monthFilter
255-
? new Date(certification.date.split(' - ')[0]).getMonth() + 1 === parseInt(monthFilter)
258+
const matchesSkill = skillFilter
259+
? certification.skills.some((skill) => skill.toLowerCase().includes(skillFilter.toLowerCase()))
256260
: true;
257-
const matchesDomain = domainFilter
258-
? certification.domains.some((domain) => domain.toLowerCase().includes(domainFilter.toLowerCase()))
261+
const matchesOrganizer = organizerFilter
262+
? certification.organizer.toLowerCase().includes(organizerFilter.toLowerCase())
259263
: true;
260-
return matchesLocation && matchesMonth && matchesDomain;
264+
return matchesSkill && matchesOrganizer;
261265
});
262266

263267
return (
264268
<>
265269
<FilterContainer>
266270
<input
267271
type="text"
268-
placeholder="Search by location"
269-
value={locationFilter}
270-
onChange={(e) => setLocationFilter(e.target.value)}
272+
placeholder="Search by Domain or skills"
273+
value={skillFilter}
274+
onChange={(e) => setSkillFilter(e.target.value)}
271275
/>
272-
<select value={monthFilter} onChange={(e) => setMonthFilter(e.target.value)}>
273-
<option value="">Select month</option>
274-
<option value="1">January</option>
275-
<option value="2">February</option>
276-
<option value="3">March</option>
277-
<option value="4">April</option>
278-
<option value="5">May</option>
279-
<option value="6">June</option>
280-
<option value="7">July</option>
281-
<option value="8">August</option>
282-
<option value="9">September</option>
283-
<option value="10">October</option>
284-
<option value="11">November</option>
285-
<option value="12">December</option>
286-
</select>
287276
<input
288277
type="text"
289-
placeholder="Search by domain"
290-
value={domainFilter}
291-
onChange={(e) => setDomainFilter(e.target.value)}
278+
placeholder="Search by organizer"
279+
value={organizerFilter}
280+
onChange={(e) => setOrganizerFilter(e.target.value)}
292281
/>
293282
</FilterContainer>
294283
<StyledcertificationListContainer>

0 commit comments

Comments
 (0)