-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
405351c
commit a06a0e7
Showing
3 changed files
with
65 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Link from 'next/link'; | ||
|
||
import styles from '../styles/jobs.module.scss'; | ||
|
||
export default function JobCard({ job }) { | ||
return ( | ||
<> | ||
<div className={styles.jobInfo}> | ||
<Link href={job.job_url}><a><h2>{job.title}</h2></a></Link> | ||
<h3>{job.company}</h3> | ||
<h4>{job.location}</h4> | ||
<h4>Date Posted: {job.date_posted}</h4> | ||
</div> | ||
</> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import JobCard from '../components/jobcard.js'; | ||
|
||
import styles from '../styles/jobs.module.scss'; | ||
|
||
export default function Podcast({ jobs }) { | ||
return ( | ||
<div className={styles.allJobs}> | ||
{jobs.map((job, index) => ( | ||
<JobCard job={job} /> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export async function getServerSideProps() { | ||
let final; | ||
let jobs; | ||
|
||
await fetch(`https://api.ethancedwards.com/jobs/v1`).then((res) => { | ||
if (!res.ok) { | ||
// TODO: make fake job saying error | ||
// final = { } | ||
} else { | ||
final = res.json(); | ||
} | ||
}); | ||
|
||
jobs = await final; | ||
|
||
return { props: { jobs } }; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
.jobInfo { | ||
color: black; | ||
border-style: solid; | ||
border-color: lightblue; | ||
padding: 5px; | ||
margin: 10px; | ||
|
||
flex-basis: calc(100% / 5); | ||
} | ||
|
||
.allJobs { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
// justify-content: space-evenly; | ||
align-content: space-between; | ||
} |