-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create layout, rework section components
- Loading branch information
1 parent
6e21f52
commit 96a154a
Showing
20 changed files
with
285 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,36 @@ | ||
import { useContext } from 'react'; | ||
import { faUserGraduate } from '@fortawesome/free-solid-svg-icons'; | ||
import { ResumeContext } from 'contexts/ResumeContext'; | ||
import { formatDateRange } from 'utils/date'; | ||
import PrimarySectionWidget from 'widgets/PrimarySectionWidget'; | ||
import type { PrimarySectionWidgetProps } from 'widgets/PrimarySectionWidget'; | ||
import type { SectionProps } from 'types/Props'; | ||
import type { ResumeEducation } from 'types/Resume'; | ||
import { joinItems } from 'utils/text'; | ||
|
||
export default function EducationSection() { | ||
const { education = [] } = useContext(ResumeContext); | ||
|
||
function formatStudyMeta(studyType: string, score: string) { | ||
const parts = [studyType, score]; | ||
return parts.filter((p) => !!p).join(' / '); | ||
} | ||
|
||
const data: PrimarySectionWidgetProps = { | ||
title: 'Education', | ||
items: education.map( | ||
export default function EducationSection({ | ||
title, | ||
subtitle, | ||
data = [], | ||
}: SectionProps<ResumeEducation[]>) { | ||
const props: PrimarySectionWidgetProps = { | ||
title, | ||
items: data.map( | ||
({ area, studyType, institution, url, courses, score, ...dates }) => { | ||
return { | ||
title: area, | ||
subtitles: [ | ||
formatStudyMeta(studyType, score), | ||
joinItems(' / ', studyType, score), | ||
{ text: institution, href: url }, | ||
], | ||
textRight: formatDateRange(dates.startDate, dates.endDate), | ||
icon: faUserGraduate, | ||
sublist: { | ||
title: 'Notable Courses', | ||
title: subtitle, | ||
items: courses, | ||
}, | ||
}; | ||
}, | ||
), | ||
}; | ||
|
||
return <PrimarySectionWidget {...data} />; | ||
return <PrimarySectionWidget {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import { useContext } from 'react'; | ||
import { ResumeContext } from 'contexts/ResumeContext'; | ||
import type { SideSectionWidgetProps } from 'widgets/SideSectionWidget'; | ||
import SideSectionWidget from 'widgets/SideSectionWidget'; | ||
import type { SideSectionWidgetProps } from 'widgets/SideSectionWidget'; | ||
import type { SectionProps } from 'types/Props'; | ||
import type { ResumeLanguage } from 'types/Resume'; | ||
|
||
export default function LanguagesSection() { | ||
const { languages = [] } = useContext(ResumeContext); | ||
|
||
const data: SideSectionWidgetProps = { | ||
title: 'Languages', | ||
items: languages.map(({ language, fluency }) => { | ||
export default function LanguagesSection({ | ||
title, | ||
data = [], | ||
}: SectionProps<ResumeLanguage[]>) { | ||
const props: SideSectionWidgetProps = { | ||
title, | ||
items: data.map(({ language, fluency }) => { | ||
return { | ||
title: language, | ||
subtitle: fluency, | ||
}; | ||
}), | ||
}; | ||
|
||
return <SideSectionWidget {...data} />; | ||
return <SideSectionWidget {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
import { useContext } from 'react'; | ||
import { faFileLines } from '@fortawesome/free-solid-svg-icons'; | ||
import { ResumeContext } from 'contexts/ResumeContext'; | ||
import { formatDate } from 'utils/date'; | ||
import PrimarySectionWidget from 'widgets/PrimarySectionWidget'; | ||
import type { PrimarySectionWidgetProps } from 'widgets/PrimarySectionWidget'; | ||
import type { SectionProps } from 'types/Props'; | ||
import type { ResumePublication } from 'types/Resume'; | ||
|
||
export default function PublicationsSection() { | ||
const { publications = [] } = useContext(ResumeContext); | ||
|
||
const data: PrimarySectionWidgetProps = { | ||
title: 'Publications', | ||
items: publications.map( | ||
({ name, publisher, url, summary, releaseDate }) => { | ||
return { | ||
title: { text: name, href: url }, | ||
subtitles: [publisher], | ||
textRight: formatDate(releaseDate), | ||
icon: faFileLines, | ||
content: summary, | ||
}; | ||
}, | ||
), | ||
export default function PublicationsSection({ | ||
title, | ||
data = [], | ||
}: SectionProps<ResumePublication[]>) { | ||
const props: PrimarySectionWidgetProps = { | ||
title, | ||
items: data.map(({ name, publisher, url, summary, releaseDate }) => { | ||
return { | ||
title: { text: name, href: url }, | ||
subtitles: [publisher], | ||
textRight: formatDate(releaseDate), | ||
icon: faFileLines, | ||
content: summary, | ||
}; | ||
}), | ||
}; | ||
|
||
return <PrimarySectionWidget {...data} />; | ||
return <PrimarySectionWidget {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.