From a06a0e7a7fd9d732815f7e17abd1b12daef2c990 Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Tue, 11 Feb 2025 14:48:48 -0500 Subject: [PATCH] jobs page MVP --- components/jobcard.js | 16 ++++++++++++++++ pages/jobs.js | 31 +++++++++++++++++++++++++++++++ styles/jobs.module.scss | 18 ++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 components/jobcard.js create mode 100644 pages/jobs.js create mode 100644 styles/jobs.module.scss diff --git a/components/jobcard.js b/components/jobcard.js new file mode 100644 index 0000000..8596523 --- /dev/null +++ b/components/jobcard.js @@ -0,0 +1,16 @@ +import Link from 'next/link'; + +import styles from '../styles/jobs.module.scss'; + +export default function JobCard({ job }) { + return ( + <> +
+

{job.title}

+

{job.company}

+

{job.location}

+

Date Posted: {job.date_posted}

+
+ + ) +} diff --git a/pages/jobs.js b/pages/jobs.js new file mode 100644 index 0000000..ee47d3e --- /dev/null +++ b/pages/jobs.js @@ -0,0 +1,31 @@ +import JobCard from '../components/jobcard.js'; + +import styles from '../styles/jobs.module.scss'; + +export default function Podcast({ jobs }) { + return ( +
+ {jobs.map((job, index) => ( + + ))} +
+ ); +} + +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 } }; +} diff --git a/styles/jobs.module.scss b/styles/jobs.module.scss new file mode 100644 index 0000000..da3b99c --- /dev/null +++ b/styles/jobs.module.scss @@ -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; +}