Refactor certification section

This commit is contained in:
Ariful Alam
2022-12-09 20:51:21 +06:00
parent fcbc08d483
commit ae8cc57533
5 changed files with 45 additions and 45 deletions

View File

@@ -68,7 +68,7 @@
✓ [Social Links](#social-links) ✓ [Social Links](#social-links)
✓ [Skill Section](#skills) ✓ [Skill Section](#skills)
✓ [Experience Section](#experience) ✓ [Experience Section](#experience)
✓ [Certifications Section](#certifications) ✓ [Certification Section](#certifications)
✓ [Education Section](#education) ✓ [Education Section](#education)
✓ [Projects Section](#projects) ✓ [Projects Section](#projects)
✓ [Blog Posts Section](#blog-posts) ✓ [Blog Posts Section](#blog-posts)
@@ -249,7 +249,7 @@ const config = {
body: 'Certification Body Name', body: 'Certification Body Name',
name: 'Sample Certification', name: 'Sample Certification',
year: 'March 2022', year: 'March 2022',
certLink: 'https://example.com' link: 'https://example.com',
}, },
], ],
education: [ education: [
@@ -491,27 +491,6 @@ module.exports = {
Empty array will hide the experience section. 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 ### Education
Provide your education history in `education`. Provide your education history in `education`.
@@ -539,6 +518,27 @@ module.exports = {
Empty array will hide the education section. Empty array will hide the education section.
### Certifications
Provide your industry certifications in `certifications`.
```js
// gitprofile.config.js
module.exports = {
// ...
certifications: [
{
name: 'Lorem ipsum',
body: 'Lorem ipsum dolor sit amet',
year: 'March 2022',
link: 'https://example.com',
},
],
};
```
Empty array will hide the certifications section.
### Projects ### Projects
Your public repo from GitHub will be displayed here automatically. You can limit how many projects do you want to be displayed. Also, you can hide forked or specific repo. Your public repo from GitHub will be displayed here automatically. You can limit how many projects do you want to be displayed. Also, you can hide forked or specific repo.

View File

@@ -25,7 +25,8 @@ const config = {
email: 'arifulalamszn@gmail.com', email: 'arifulalamszn@gmail.com',
}, },
resume: { resume: {
fileUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf', // Empty fileUrl will hide the `Download Resume` button. fileUrl:
'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf', // Empty fileUrl will hide the `Download Resume` button.
}, },
skills: [ skills: [
'PHP', 'PHP',
@@ -59,14 +60,14 @@ const config = {
companyLink: 'https://example.com', companyLink: 'https://example.com',
}, },
], ],
certifications: [ /* certifications: [
{ {
body: 'Certification Body Name', name: 'Lorem ipsum',
name: 'My Sample Certification', body: 'Lorem ipsum dolor sit amet',
year: 'March 2022', year: 'March 2022',
certLink: 'https://example.com' link: 'https://example.com'
}, },
], ], */
education: [ education: [
{ {
institution: 'Institution Name', institution: 'Institution Name',

View File

@@ -7,7 +7,7 @@ import AvatarCard from './avatar-card';
import Details from './details'; import Details from './details';
import Skill from './skill'; import Skill from './skill';
import Experience from './experience'; import Experience from './experience';
import Certifications from './certifications'; import Certification from './certification';
import Education from './education'; import Education from './education';
import Project from './project'; import Project from './project';
import Blog from './blog'; import Blog from './blog';
@@ -184,14 +184,14 @@ const GitProfile = ({ config }) => {
loading={loading} loading={loading}
experiences={sanitizedConfig.experiences} experiences={sanitizedConfig.experiences}
/> />
<Certifications
loading={loading}
certifications={sanitizedConfig.certifications}
/>
<Education <Education
loading={loading} loading={loading}
education={sanitizedConfig.education} education={sanitizedConfig.education}
/> />
<Certification
loading={loading}
certifications={sanitizedConfig.certifications}
/>
</div> </div>
</div> </div>
<div className="lg:col-span-2 col-span-1"> <div className="lg:col-span-2 col-span-1">
@@ -282,6 +282,7 @@ GitProfile.propTypes = {
body: PropTypes.string, body: PropTypes.string,
name: PropTypes.string, name: PropTypes.string,
year: PropTypes.string, year: PropTypes.string,
link: PropTypes.string,
}) })
), ),
education: PropTypes.arrayOf( education: PropTypes.arrayOf(

View File

@@ -2,7 +2,7 @@ import { skeleton } from '../../helpers/utils';
import { Fragment } from 'react'; import { Fragment } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
const ListItem = ({ year, name, body, certLink }) => ( const ListItem = ({ year, name, body, link }) => (
<li className="mb-5 ml-4"> <li className="mb-5 ml-4">
<div <div
className="absolute w-2 h-2 bg-base-300 rounded-full border border-base-300 mt-1.5" className="absolute w-2 h-2 bg-base-300 rounded-full border border-base-300 mt-1.5"
@@ -10,7 +10,7 @@ const ListItem = ({ year, name, body, certLink }) => (
></div> ></div>
<div className="my-0.5 text-xs">{year}</div> <div className="my-0.5 text-xs">{year}</div>
<div className="font-semibold"> <div className="font-semibold">
<a href={certLink} target="_blank" rel="noreferrer"> <a href={link} target="_blank" rel="noreferrer">
{name} {name}
</a> </a>
</div> </div>
@@ -18,7 +18,7 @@ const ListItem = ({ year, name, body, certLink }) => (
</li> </li>
); );
const Certifications = ({ certifications, loading }) => { const Certification = ({ certifications, loading }) => {
const renderSkeleton = () => { const renderSkeleton = () => {
let array = []; let array = [];
for (let index = 0; index < 2; index++) { for (let index = 0; index < 2; index++) {
@@ -53,7 +53,7 @@ const Certifications = ({ certifications, loading }) => {
skeleton({ width: 'w-32', height: 'h-8' }) skeleton({ width: 'w-32', height: 'h-8' })
) : ( ) : (
<span className="text-base-content opacity-70"> <span className="text-base-content opacity-70">
Certifications Certification
</span> </span>
)} )}
</h5> </h5>
@@ -70,9 +70,7 @@ const Certifications = ({ certifications, loading }) => {
year={`${certification.year}`} year={`${certification.year}`}
name={certification.name} name={certification.name}
body={certification.body} body={certification.body}
certLink={ link={certification.link ? certification.link : null}
certification.certLink ? certification.certLink : null
}
/> />
))} ))}
</Fragment> </Fragment>
@@ -90,12 +88,12 @@ ListItem.propTypes = {
year: PropTypes.node, year: PropTypes.node,
name: PropTypes.node, name: PropTypes.node,
body: PropTypes.node, body: PropTypes.node,
certLink: PropTypes.string, link: PropTypes.string,
}; };
Certifications.propTypes = { Certification.propTypes = {
certifications: PropTypes.array.isRequired, certifications: PropTypes.array.isRequired,
loading: PropTypes.bool.isRequired, loading: PropTypes.bool.isRequired,
}; };
export default Certifications; export default Certification;

2
types/index.d.ts vendored
View File

@@ -218,7 +218,7 @@ export interface Certifications {
body?: string; body?: string;
name?: string; name?: string;
year?: string; year?: string;
certLink?: string; link?: string;
} }
export interface Education { export interface Education {