Merge pull request #520 from arifszn/handle-empty-section-item

Handle empty section item
This commit is contained in:
Ariful Alam 2024-02-28 16:28:28 +06:00 committed by GitHub
commit 0b7eed46b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 52 additions and 32 deletions

View File

@ -78,15 +78,22 @@ const CertificationCard = ({
renderSkeleton()
) : (
<>
{certifications.map((certification, index) => (
<ListItem
key={index}
year={`${certification.year}`}
name={certification.name}
body={certification.body}
link={certification.link ? certification.link : undefined}
/>
))}
{certifications
.filter(
(certification) =>
certification.year ||
certification.name ||
certification.body,
)
.map((certification, index) => (
<ListItem
key={index}
year={certification.year}
name={certification.name}
body={certification.body}
link={certification.link}
/>
))}
</>
)}
</ol>

View File

@ -70,14 +70,19 @@ const EducationCard = ({
renderSkeleton()
) : (
<>
{educations.map((item, index) => (
<ListItem
key={index}
time={`${item.from} - ${item.to}`}
degree={item.degree}
institution={item.institution}
/>
))}
{educations
.filter(
(item) =>
item.institution || item.degree || item.from || item.to,
)
.map((item, index) => (
<ListItem
key={index}
time={`${item.from} - ${item.to}`}
degree={item.degree}
institution={item.institution}
/>
))}
</>
)}
</ol>

View File

@ -75,19 +75,27 @@ const ExperienceCard = ({
renderSkeleton()
) : (
<Fragment>
{experiences.map((experience, index) => (
<ListItem
key={index}
time={`${experience.from} - ${experience.to}`}
position={experience.position}
company={experience.company}
companyLink={
experience.companyLink
? experience.companyLink
: undefined
}
/>
))}
{experiences
.filter(
(experience) =>
experience.company ||
experience.position ||
experience.from ||
experience.to,
)
.map((experience, index) => (
<ListItem
key={index}
time={`${experience.from} - ${experience.to}`}
position={experience.position}
company={experience.company}
companyLink={
experience.companyLink
? experience.companyLink
: undefined
}
/>
))}
</Fragment>
)}
</ol>

View File

@ -98,9 +98,9 @@ const GithubProjectCard = ({
<div className="flex justify-between flex-col p-8 h-full w-full">
<div>
<div className="flex items-center">
<div className="card-title text-lg tracking-wide flex text-base-content opacity-60">
<div className="card-title text-lg tracking-wide flex text-base-content opacity-60 truncate">
<MdInsertLink className="my-auto" />
<span>{item.name}</span>
<span className="truncate">{item.name}</span>
</div>
</div>
<p className="mb-5 mt-1 text-base-content text-opacity-60 text-sm">