Refactor JobHistory
This commit is contained in:
parent
2308c0394b
commit
ecefefb757
@ -5,7 +5,6 @@ import Col from 'react-bootstrap/Col';
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import JobCard from './JobCard';
|
||||
import { usePersonContext } from './PersonContext';
|
||||
import { Job } from '../../PersonalDataTypes';
|
||||
import { partition } from '../utils';
|
||||
|
||||
const entriesPerRow = 2
|
||||
@ -13,20 +12,13 @@ const entriesPerRow = 2
|
||||
export default function JobsHistory() {
|
||||
const person = usePersonContext()
|
||||
|
||||
function JobEntry(job: Job, heading?: string) {
|
||||
return <JobCard
|
||||
heading={heading}
|
||||
{...job}
|
||||
/>
|
||||
}
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<h2>Experience</h2>
|
||||
{person.jobs.current && (
|
||||
<Row>
|
||||
<Col>
|
||||
{JobEntry(person.jobs.current, 'Current position')}
|
||||
<JobCard heading={'Current position'} {...person.jobs.current} />
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
@ -34,7 +26,7 @@ export default function JobsHistory() {
|
||||
<Row key={index}>
|
||||
{(jobs.map((job, subindex) => (
|
||||
<Col key={index + '_' + subindex}>
|
||||
{JobEntry(job)}
|
||||
<JobCard {...job} />
|
||||
</Col>
|
||||
)))}
|
||||
</Row>
|
||||
|
Loading…
Reference in New Issue
Block a user