-
Notifications
You must be signed in to change notification settings - Fork 50
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
Showing
8 changed files
with
382 additions
and
29 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
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
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,30 @@ | ||
import { Link } from "react-router-dom"; | ||
|
||
const ResourceCard = ({ idx, resource }) => { | ||
return <div key={idx} className="dark:bg-black rounded-lg shadow-lg overflow-hidden hover:shadow-xl transition-shadow duration-300"> | ||
{resource.image && ( | ||
<div className="grid items-center"> | ||
<img | ||
src={resource.image} | ||
alt={resource.title} | ||
onError={(e) => { e.target.src = "assets/logo.png"; }} | ||
className="h-40 object-cover object-center " | ||
/> | ||
</div> | ||
)} | ||
<div className="p-6"> | ||
<h3 className="text-lg font-semibold mb-2">{resource.title}</h3> | ||
<p className="text-gray-700 mb-4">{resource.description}</p> | ||
<Link | ||
to={resource.link} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="text-blue-600 hover:underline" | ||
> | ||
Learn More | ||
</Link> | ||
</div> | ||
</div>; | ||
}; | ||
|
||
export default ResourceCard; |
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 |
---|---|---|
@@ -1,21 +1,18 @@ | ||
import { Link } from "react-router-dom"; | ||
|
||
const ResourceSection = ({ title, resources }) => ( | ||
<section className="my-10"> | ||
<h2 className="text-2xl font-bold mb-4">{title}</h2> | ||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> | ||
{resources.map((resource, index) => ( | ||
<div key={index} className="p-4 bg-black rounded-lg shadow-md flex flex-col items-center overflow-hidden"> | ||
{resource.image && <img src={resource.image} alt={resource.title} className="mb-4 object-cover object-center w-full h-36 rounded-t-lg" />} | ||
<h3 className="text-xl font-semibold mb-2">{resource.title}</h3> | ||
<p className="mb-4">{resource.description}</p> | ||
<Link to={resource.link} target="_blank" rel="noopener noreferrer" className="text-blue-500 underline"> | ||
Learn More | ||
</Link> | ||
</div> | ||
))} | ||
</div> | ||
</section> | ||
); | ||
import ResourceCard from "./ResourceCard"; | ||
|
||
const ResourceSection = ({ id, title, resources }) => { | ||
return ( | ||
<section id={id} className="my-12"> | ||
<h2 className="text-3xl font-bold mb-10 text-center">{title}</h2> | ||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-8"> | ||
{resources.length === 0 ? <div> | ||
<h3 className="text-xl font-medium text-center mb-20">No resources found</h3> | ||
</div> : | ||
resources.map((resource, index) => ( | ||
<ResourceCard idx={index} resource={resource} /> | ||
))} | ||
</div> | ||
</section> | ||
); | ||
} | ||
export default ResourceSection; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.