Browse Source

Refactor JobHistory

master
Dejvino 11 months ago
parent
commit
ecefefb757
1 changed files with 3 additions and 11 deletions
  1. +3
    -11
      src/app/components/JobsHistory.tsx

+ 3
- 11
src/app/components/JobsHistory.tsx View File

@@ -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,11 +26,11 @@ export default function JobsHistory() {
<Row key={index}>
{(jobs.map((job, subindex) => (
<Col key={index + '_' + subindex}>
{JobEntry(job)}
<JobCard {...job} />
</Col>
)))}
</Row>
))}
))}
</Container>
)
}

Loading…
Cancel
Save