Skip to content

Commit

Permalink
before adding routing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Camilo committed Aug 3, 2024
1 parent f96af33 commit 595070b
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 154 deletions.
11 changes: 10 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"react-icons": "^5.2.1"
},
"devDependencies": {
"@types/react": "^18.3.3",
Expand Down
120 changes: 10 additions & 110 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,124 +1,24 @@
import Navbar from "./components/Navbar";
import Hero from "./components/Hero";
import HomeCards from "./components/HomeCards";
import JobListings from "./components/JobListings";
import ViewAllJobs from "./components/ViewAllJobs";

const App = () => {
return (
<>
<Navbar />
<Hero title='Become a React Dev' subtitle='Find the React job that fits your skills and needs!'/>
<HomeCards />


{/* <!-- Browse Jobs --> */}
<section className="bg-blue-50 px-4 py-10">
<div className="container-xl lg:container m-auto">
<h2 className="text-3xl font-bold text-indigo-500 mb-6 text-center">
Browse Jobs
</h2>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
{/* <!-- Job Listing 1 --> */}
<div className="bg-white rounded-xl shadow-md relative">
<div className="p-4">
<div className="mb-6">
<div className="text-gray-600 my-2">Full-Time</div>
<h3 className="text-xl font-bold">Senior React Developer</h3>
</div>

<div className="mb-5">
We are seeking a talented Front-End Developer to join our team in Boston, MA. The ideal candidate will have strong skills in HTML, CSS, and JavaScript...
</div>

<h3 className="text-indigo-500 mb-2">$70 - $80K / Year</h3>

<div className="border border-gray-100 mb-5"></div>

<div className="flex flex-col lg:flex-row justify-between mb-4">
<div className="text-orange-700 mb-3">
<i className="fa-solid fa-location-dot text-lg"></i>
Boston, MA
</div>
<a
href="job.html"
className="h-[36px] bg-indigo-500 hover:bg-indigo-600 text-white px-4 py-2 rounded-lg text-center text-sm"
>
Read More
</a>
</div>
</div>
</div>
{/* <!-- Job Listing 2 --> */}
<div className="bg-white rounded-xl shadow-md relative">
<div className="p-4">
<div className="mb-6">
<div className="text-gray-600 my-2">Remote</div>
<h3 className="text-xl font-bold">Front-End Engineer (React)</h3>
</div>

<div className="mb-5">
Join our team as a Front-End Developer in sunny Miami, FL. We are looking for a motivated individual with a passion...
</div>

<h3 className="text-indigo-500 mb-2">$70K - $80K / Year</h3>

<div className="border border-gray-100 mb-5"></div>

<div className="flex flex-col lg:flex-row justify-between mb-4">
<div className="text-orange-700 mb-3">
<i className="fa-solid fa-location-dot text-lg"></i>
Miami, FL
</div>
<a
href="job.html"
className="h-[36px] bg-indigo-500 hover:bg-indigo-600 text-white px-4 py-2 rounded-lg text-center text-sm"
>
Read More
</a>
</div>
</div>
</div>
{/* <!-- Job Listing 3 --> */}
<div className="bg-white rounded-xl shadow-md relative">
<div className="p-4">
<div className="mb-6">
<div className="text-gray-600 my-2">Remote</div>
<h3 className="text-xl font-bold">React.js Developer</h3>
</div>

<div className="mb-5">
Are you passionate about front-end development? Join our team in vibrant Brooklyn, NY, and work on exciting projects that make a difference...
</div>

<h3 className="text-indigo-500 mb-2">$70K - $80K / Year</h3>

<div className="border border-gray-100 mb-5"></div>

<div className="flex flex-col lg:flex-row justify-between mb-4">
<div className="text-orange-700 mb-3">
<i className="fa-solid fa-location-dot text-lg"></i>
Brooklyn, NY
</div>
<a
href="job.html"
className="h-[36px] bg-indigo-500 hover:bg-indigo-600 text-white px-4 py-2 rounded-lg text-center text-sm"
>
Read More
</a>
</div>
</div>
</div>
</div>
</div>
</section>

<section className="m-auto max-w-lg my-10 px-6">
<a
href="jobs.html"
className="block bg-black text-white text-center py-4 px-6 rounded-xl hover:bg-gray-700"
>View All Jobs</a >
</section>
<JobListings />
<ViewAllJobs />
</>
)
};

export default App;
export default App;



// Next Lesson Use State
// https://www.youtube.com/watch?v=LDB4uaJ87e0&t=1644s
1 change: 0 additions & 1 deletion src/components/HomeCards.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Card from "./Card"

const HomeCards = () => {

return (
<>
<section className="py-4">
Expand Down
52 changes: 52 additions & 0 deletions src/components/JobListing.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import JobType from "../data/dataTypes/job"
import { useState } from "react";
import { FaMapMarker} from "react-icons/fa"

interface JobListingProps {
job: JobType;
}

const JobListing: React.FC<JobListingProps> = ({ job }) => {
const [showFullDescription, setShowFullDescription] = useState(false);
let description = job.description;

if(!showFullDescription)
{
description = description.substring(0, 100) + "...";
}



return (
<div className="bg-white rounded-xl shadow-md relative">
<div className="p-4">
<div className="mb-6">
<div className="text-gray-600 my-2">{job.type}</div>
<h3 className="text-xl font-bold">{job.title}</h3>
</div>

<div className="mb-5">{description}</div>
<button onClick={() => setShowFullDescription((prevState) => !prevState) }
className="text-indigo-500 mb-5 hover:text-indigo-600">
{showFullDescription ? "Less" : "More"}
</button>
<h3 className="text-indigo-500 mb-2">{job.salary}/ Year</h3>
<div className="border border-gray-100 mb-5"></div>

<div className="flex flex-col lg:flex-row justify-between mb-4">
<div className="text-orange-700 mb-3">
<FaMapMarker className="inline text-lg mb-1 mr-1" />
{job.location}
</div>
<a
href={`/job/${job.id}`}
className="h-[36px] bg-indigo-500 hover:bg-indigo-600 text-white px-4 py-2 rounded-lg text-center text-sm">
Read More
</a>
</div>
</div>
</div>
)
}

export default JobListing;
27 changes: 27 additions & 0 deletions src/components/JobListings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import jobs from "../data/jobs.json"
import JobType from "../data/dataTypes/job"
import JobListing from "./JobListing"

const JobListings = () => {
const recentJob: JobType[] = jobs.slice(0, 3);

return (
<>
<section className="bg-blue-50 px-4 py-10">
<div className="container-xl lg:container m-auto">
<h2 className="text-3xl font-bold text-indigo-500 mb-6 text-center">
Browse Jobs
</h2>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">

{ recentJob.map((job: JobType) => (
<JobListing key={job.id} job={job} />
))}
</div>
</div>
</section >
</>
)
}

export default JobListings;
11 changes: 11 additions & 0 deletions src/components/ViewAllJobs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const ViewAllJobs = () => {
return (
<section className="m-auto max-w-lg my-10 px-6">
<a
href="/jobs"
className="block bg-black text-white text-center py-4 px-6 rounded-xl hover:bg-gray-700"
> View All Jobs</a>
</section>
)
}
export default ViewAllJobs;
14 changes: 14 additions & 0 deletions src/data/dataTypes/job.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default interface JobType {
id: string;
title: string;
type: string;
description: string;
location: string;
salary: string;
company: {
name: string;
description: string;
contactEmail: string;
contactPhone: string;
};
}
Loading

0 comments on commit 595070b

Please sign in to comment.