diff --git a/README.md b/README.md index f6f89c3..9e78983 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ ✓ [Social Links](#social-links) ✓ [Skill Section](#skills) ✓ [Experience Section](#experience) +✓ [Certifications Section](#certifications) ✓ [Education Section](#education) ✓ [Projects Section](#projects) ✓ [Blog Posts Section](#blog-posts) @@ -243,6 +244,14 @@ const config = { companyLink: 'https://example.com', }, ], + certifications: [ + { + body: 'Certification Body Name', + name: 'Sample Certification', + year: 'March 2022', + certLink: 'https://example.com' + }, + ], education: [ { institution: 'Institution Name', @@ -482,6 +491,27 @@ module.exports = { Empty array will hide the experience section. +### Certifications + +Provide your industry certifications in `certifications`. + +```js +// gitprofile.config.js +module.exports = { + // ... + certifications: [ + { + body: 'Certification Body Name', + name: 'My Sample Certification', + year: 'March 2022', + certLink: 'https://example.com' + }, + ], +}; +``` + +Empty array will hide the certifications section. + ### Education Provide your education history in `education`. diff --git a/gitprofile.config.js b/gitprofile.config.js index f9e9542..fde1b12 100644 --- a/gitprofile.config.js +++ b/gitprofile.config.js @@ -59,6 +59,14 @@ const config = { companyLink: 'https://example.com', }, ], + certifications: [ + { + body: 'Certification Body Name', + name: 'My Sample Certification', + year: 'March 2022', + certLink: 'https://example.com' + }, + ], education: [ { institution: 'Institution Name', diff --git a/src/components/GitProfile.jsx b/src/components/GitProfile.jsx index 4aaef5f..7640fbe 100644 --- a/src/components/GitProfile.jsx +++ b/src/components/GitProfile.jsx @@ -7,6 +7,7 @@ import AvatarCard from './avatar-card'; import Details from './details'; import Skill from './skill'; import Experience from './experience'; +import Certifications from './certifications'; import Education from './education'; import Project from './project'; import Blog from './blog'; @@ -183,6 +184,10 @@ const GitProfile = ({ config }) => { loading={loading} experiences={sanitizedConfig.experiences} /> + ( + + + {year} + + + {name} + + + {body} + +); + +const Certifications = ({ certifications, loading }) => { + const renderSkeleton = () => { + let array = []; + for (let index = 0; index < 2; index++) { + array.push( + + ); + } + + return array; + }; + + return ( + <> + {certifications?.length !== 0 && ( + + + + + {loading ? ( + skeleton({ width: 'w-32', height: 'h-8' }) + ) : ( + + Certifications + + )} + + + + + {loading ? ( + renderSkeleton() + ) : ( + + {certifications.map((certification, index) => ( + + ))} + + )} + + + + + )} + > + ); +}; + +ListItem.propTypes = { + year: PropTypes.node, + name: PropTypes.node, + body: PropTypes.node, + certLink: PropTypes.string, +}; + +Certifications.propTypes = { + certifications: PropTypes.array.isRequired, + loading: PropTypes.bool.isRequired, +}; + +export default Certifications; diff --git a/src/helpers/utils.jsx b/src/helpers/utils.jsx index 8476645..e4fa356 100644 --- a/src/helpers/utils.jsx +++ b/src/helpers/utils.jsx @@ -163,6 +163,7 @@ export const sanitizeConfig = (config) => { }, skills: config?.skills || [], experiences: config?.experiences || [], + certifications: config?.certifications || [], education: config?.education || [], blog: { source: config?.blog?.source, diff --git a/types/index.d.ts b/types/index.d.ts index e66253a..6290dcb 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -214,6 +214,12 @@ export interface Experience { to?: string; companyLink?: string; } +export interface Certifications { + body?: string; + name?: string; + year?: string; + certLink?: string; +} export interface Education { institution?: string; @@ -252,6 +258,11 @@ export interface Config { */ experiences?: Array; + /** + * Certifications list + */ + certifications?: Array; + /** * Education list */