diff --git a/src/pages/Dashboard/EducationSection.tsx b/src/pages/Dashboard/EducationSection.tsx new file mode 100644 index 0000000..ee1c668 --- /dev/null +++ b/src/pages/Dashboard/EducationSection.tsx @@ -0,0 +1,49 @@ +import React, {FC} from 'react'; +// Typing +import Education from '../../types/Education'; + +import {getTimePeriod} from '../../types/TimePeriod'; + +interface IProps { + educations: Education[]; + handleDelete: ( + id: number, + entries: Education[], + ) => (e: React.MouseEvent) => void; +} +const DashboardEducationSection: FC = ({educations, handleDelete}) => { + return ( + <> +

Education Credentials

+ + + + + + + + + + + {educations?.map((edu: Education, i: number) => ( + + + + + + + ))} + +
SchoolDegreeYears
{edu.school}{edu.degree}{getTimePeriod(edu.from, edu.to)} + +
+ + ); +}; + +export default DashboardEducationSection; diff --git a/src/pages/Dashboard/ExperienceSection.tsx b/src/pages/Dashboard/ExperienceSection.tsx index cdece49..20e4678 100644 --- a/src/pages/Dashboard/ExperienceSection.tsx +++ b/src/pages/Dashboard/ExperienceSection.tsx @@ -27,7 +27,7 @@ const DashboardExperienceSection: FC = ({ - {experiences.map((exp: Experience) => ( + {experiences?.map((exp: Experience) => ( {exp.company} {exp.position} diff --git a/src/pages/Dashboard/index.tsx b/src/pages/Dashboard/index.tsx index 0f4edb9..b593b65 100644 --- a/src/pages/Dashboard/index.tsx +++ b/src/pages/Dashboard/index.tsx @@ -15,6 +15,7 @@ import Experience from '../../types/Experience'; import {getTimePeriod} from '../../types/TimePeriod'; import Education from '../../types/Education'; import DashboardExperienceSection from './ExperienceSection'; +import DashboardEducationSection from './EducationSection'; interface IProps extends Dev, WithFirebaseProps {} /** @@ -62,41 +63,16 @@ const Dashboard: FC = ({
- {!!experiences && ( - - )} + + + -

Education Credentials

- - - - - - - - - - - {educations?.map((edu: Education, i: number) => ( - - - - - - - ))} - -
SchoolDegreeYears
{edu.school}{edu.degree}{getTimePeriod(edu.from, edu.to)} - -