diff --git a/src/app/_jobcard/JobCard.tsx b/src/app/_jobcard/JobCard.tsx new file mode 100644 index 0000000..4e8fdca --- /dev/null +++ b/src/app/_jobcard/JobCard.tsx @@ -0,0 +1,17 @@ +import { Job } from "../page"; + + + +export default async function JobCard(props: {job: Job}) { + const { title, company, date_posted, description, img, link, location, url } = props.job; + return ( + + + + + + + + + ) +} \ No newline at end of file diff --git a/src/app/globals.css b/src/app/globals.css index 875c01e..b5c61c9 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,33 +1,3 @@ @tailwind base; @tailwind components; @tailwind utilities; - -:root { - --foreground-rgb: 0, 0, 0; - --background-start-rgb: 214, 219, 220; - --background-end-rgb: 255, 255, 255; -} - -@media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-start-rgb: 0, 0, 0; - --background-end-rgb: 0, 0, 0; - } -} - -body { - color: rgb(var(--foreground-rgb)); - background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) - rgb(var(--background-start-rgb)); -} - -@layer utilities { - .text-balance { - text-wrap: balance; - } -} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3314e47..0b8ac87 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -5,8 +5,8 @@ import "./globals.css"; const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "Junior and Mid-Level Software Engineer Jobs", + description: "Get the latest job openings from the sw-jobs-api", }; export default function RootLayout({ diff --git a/src/app/page.tsx b/src/app/page.tsx index 2acfd44..88b9c48 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,113 +1,70 @@ -import Image from "next/image"; +"use client"; +import { useState, useEffect } from "react"; + +interface JobPosting { + id: number; // Assuming each job has an id + title: string; + logo: string; + company: string; + location: string; + type: string; + description: string; + link: string; + skills: { + react: boolean; + python: boolean; + golang: boolean; + svelte: boolean; + nextjs: boolean; + typescript: boolean; + tailwind: boolean; + }; +} + +async function fetchJobs(): Promise { + const response = await fetch("http://51.20.250.24/jobs"); + if (!response.ok) { + throw new Error("Failed to fetch jobs"); + } + return response.json(); +} export default function Home() { + const [jobs, setJobs] = useState([]); + + useEffect(() => { + const getJobs = async () => { + try { + const jobsData = await fetchJobs(); + setJobs(jobsData); + } catch (error) { + console.error("Error fetching jobs:", error); + } + }; + getJobs(); + }, []); + return ( -
-
); } diff --git a/tailwind.config.ts b/tailwind.config.ts index e9a0944..029026a 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -7,13 +7,7 @@ const config: Config = { "./src/app/**/*.{js,ts,jsx,tsx,mdx}", ], theme: { - extend: { - backgroundImage: { - "gradient-radial": "radial-gradient(var(--tw-gradient-stops))", - "gradient-conic": - "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))", - }, - }, + extend: {}, }, plugins: [], };