From 034dbe0d2ccbb9c6e2ea8e12dff09af9a5e33978 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sat, 20 Jan 2024 18:34:32 +0600 Subject: [PATCH] Decide if the card should be displayed at higher level --- src/components/certification-card/index.tsx | 72 +++++++++---------- src/components/education-card/index.tsx | 66 ++++++++---------- src/components/experience-card/index.tsx | 76 ++++++++++----------- src/components/gitprofile.tsx | 40 ++++++----- src/components/skill-card/index.tsx | 56 +++++++-------- 5 files changed, 147 insertions(+), 163 deletions(-) diff --git a/src/components/certification-card/index.tsx b/src/components/certification-card/index.tsx index 4dbffdb..0a605b5 100644 --- a/src/components/certification-card/index.tsx +++ b/src/components/certification-card/index.tsx @@ -59,46 +59,40 @@ const CertificationCard = ({ }; return ( - <> - {certifications?.length !== 0 && ( -
-
-
-
- {loading ? ( - skeleton({ widthCls: 'w-32', heightCls: 'h-8' }) - ) : ( - - Certification - - )} -
-
-
-
    - {loading ? ( - renderSkeleton() - ) : ( - <> - {certifications.map((certification, index) => ( - - ))} - - )} -
-
-
+
+
+
+
+ {loading ? ( + skeleton({ widthCls: 'w-32', heightCls: 'h-8' }) + ) : ( + + Certification + + )} +
- )} - +
+
    + {loading ? ( + renderSkeleton() + ) : ( + <> + {certifications.map((certification, index) => ( + + ))} + + )} +
+
+
+
); }; diff --git a/src/components/education-card/index.tsx b/src/components/education-card/index.tsx index 641eac2..be52948 100644 --- a/src/components/education-card/index.tsx +++ b/src/components/education-card/index.tsx @@ -53,43 +53,37 @@ const EducationCard = ({ }; return ( - <> - {educations?.length !== 0 && ( -
-
-
-
- {loading ? ( - skeleton({ widthCls: 'w-32', heightCls: 'h-8' }) - ) : ( - - Education - - )} -
-
-
-
    - {loading ? ( - renderSkeleton() - ) : ( - <> - {educations.map((item, index) => ( - - ))} - - )} -
-
-
+
+
+
+
+ {loading ? ( + skeleton({ widthCls: 'w-32', heightCls: 'h-8' }) + ) : ( + Education + )} +
- )} - +
+
    + {loading ? ( + renderSkeleton() + ) : ( + <> + {educations.map((item, index) => ( + + ))} + + )} +
+
+
+
); }; diff --git a/src/components/experience-card/index.tsx b/src/components/experience-card/index.tsx index 0c806fe..cc58dea 100644 --- a/src/components/experience-card/index.tsx +++ b/src/components/experience-card/index.tsx @@ -58,48 +58,42 @@ const ExperienceCard = ({ return array; }; return ( - <> - {experiences?.length !== 0 && ( -
-
-
-
- {loading ? ( - skeleton({ widthCls: 'w-32', heightCls: 'h-8' }) - ) : ( - - Experience - - )} -
-
-
-
    - {loading ? ( - renderSkeleton() - ) : ( - - {experiences.map((experience, index) => ( - - ))} - - )} -
-
-
+
+
+
+
+ {loading ? ( + skeleton({ widthCls: 'w-32', heightCls: 'h-8' }) + ) : ( + Experience + )} +
- )} - +
+
    + {loading ? ( + renderSkeleton() + ) : ( + + {experiences.map((experience, index) => ( + + ))} + + )} +
+
+
+
); }; diff --git a/src/components/gitprofile.tsx b/src/components/gitprofile.tsx index 98a88d2..7d1ca0f 100644 --- a/src/components/gitprofile.tsx +++ b/src/components/gitprofile.tsx @@ -217,22 +217,30 @@ const GitProfile = ({ config }: { config: Config }) => { github={sanitizedConfig.github} social={sanitizedConfig.social} /> - - - - + {sanitizedConfig.skills.length !== 0 && ( + + )} + {sanitizedConfig.experiences.length !== 0 && ( + + )} + {sanitizedConfig.certifications.length !== 0 && ( + + )} + {sanitizedConfig.educations.length !== 0 && ( + + )}
diff --git a/src/components/skill-card/index.tsx b/src/components/skill-card/index.tsx index 668fb3e..66fbff9 100644 --- a/src/components/skill-card/index.tsx +++ b/src/components/skill-card/index.tsx @@ -21,39 +21,33 @@ const SkillCard = ({ }; return ( - <> - {skills?.length !== 0 && ( -
-
-
-
- {loading ? ( - skeleton({ widthCls: 'w-32', heightCls: 'h-8' }) - ) : ( - - Tech Stack - - )} -
-
-
-
- {loading - ? renderSkeleton() - : skills.map((skill, index) => ( -
- {skill} -
- ))} -
-
+
+
+
+
+ {loading ? ( + skeleton({ widthCls: 'w-32', heightCls: 'h-8' }) + ) : ( + Tech Stack + )} +
+
+
+
+ {loading + ? renderSkeleton() + : skills.map((skill, index) => ( +
+ {skill} +
+ ))}
- )} - +
+
); };