|
|
@@ -4,25 +4,35 @@ import Container from 'react-bootstrap/Container'; |
|
|
|
import Col from 'react-bootstrap/Col'; |
|
|
|
import Row from 'react-bootstrap/Row'; |
|
|
|
import JobCard from './JobCard'; |
|
|
|
import { usePersonContext } from './PersonContext'; |
|
|
|
import { partition } from '../utils'; |
|
|
|
import { Jobs } from '@/PersonalDataTypes'; |
|
|
|
|
|
|
|
const entriesPerRow = 2 |
|
|
|
export type Props = { |
|
|
|
jobs: Jobs, |
|
|
|
heading: string, |
|
|
|
entriesPerRow?: number, |
|
|
|
currentHeading?: string, |
|
|
|
} |
|
|
|
|
|
|
|
export default function JobsHistory() { |
|
|
|
const person = usePersonContext() |
|
|
|
const defaultProps = { |
|
|
|
entriesPerRow: 2, |
|
|
|
currentHeading: 'Currently', |
|
|
|
} |
|
|
|
|
|
|
|
export default function JobHistory(props: Props) { |
|
|
|
const jobs = props.jobs |
|
|
|
const config = {...defaultProps, ...props} |
|
|
|
return ( |
|
|
|
<Container> |
|
|
|
<h2>Experience</h2> |
|
|
|
{person.jobs.current && ( |
|
|
|
<h2>{config.heading}</h2> |
|
|
|
{jobs.current && ( |
|
|
|
<Row> |
|
|
|
<Col> |
|
|
|
<JobCard heading={'Current position'} {...person.jobs.current} /> |
|
|
|
<JobCard heading={config.currentHeading} {...jobs.current} /> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
)} |
|
|
|
{partition(person.jobs.previous, entriesPerRow).map((jobs, index) => ( |
|
|
|
{partition(jobs.previous, config.entriesPerRow).map((jobs, index) => ( |
|
|
|
<Row key={index}> |
|
|
|
{(jobs.map((job, subindex) => ( |
|
|
|
<Col key={index + '_' + subindex}> |