Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8 marketing card #60

Merged
merged 5 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/marketing-icons/sec1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/marketing-icons/sec2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/marketing-icons/sec3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/components/marketing-card/Card.jsx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, Mohamed! 👏 I really like the sectionWithCard.

The design includes sections with different numbers of cards, some with 3 cards and others with 4 If you modify the sectionWithCard component to accept elements as children, it will provide more flexibility.

Also, consider removing the borders .

There seems to be a minor issue in the description – please check the screenshot provided for clarification.

Screenshot 2023-10-20 at 11-40-18 Screenshot

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";

const Card = ({ icon, title, children }) => {
return (
<div className='p-4 mb-4 w-1/3 flex justify-center items-center'>
<div className='text-center '>
{icon}
<h3 className='p-2 font-bold'>{title}</h3>
{children}
</div>
</div>
);
};

export default Card;
49 changes: 49 additions & 0 deletions src/components/marketing-card/SectionWithCards.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from "react";
import Card from "./Card";

const SectionWithCards = () => {
return (
<section className='bg-gray-100 p-8 border w-5/6 mx-auto text-center my-6 '>
<h2 className='text-2xl font-bold mb-8 '>Section Title</h2>

<div className='flex flex-wrap items-center mx-4 border-red'>
<div className='w-full md:w-1/3 px-4 mb-4 flex flex-col items-center justify-center border border-blue-600'>
<Card>
<img
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to add to what @ismail-benlaredj said it's recommended you use Image when importing images and import it from "Next" for built-in optimization instead of using img .

className='pb-4'
src='./marketing-icons/sec1.png'
alt='Icon'
/>
<h3 className='text-xl font-bold mb-2'>Card 1 Title</h3>
<p>Card 1 Content</p>
</Card>
</div>

<div className='w-full md:w-1/3 px-4 mb-4 bg-white flex flex-col items-center justify-center border border-blue-600'>
<Card>
<img
className='pb-4'
src='./marketing-icons/sec1.png'
alt='Icon'
/>
<h3 className='text-xl font-bold mb-2'>Card 1 Title</h3>
<p>Card 1 Content</p>
</Card>
</div>
<div className='w-full md:w-1/3 px-4 mb-4 bg-white flex flex-col items-center justify-center border border-blue-600'>
<Card>
<img
className='pb-4'
src='./marketing-icons/sec1.png'
alt='Icon'
/>
<h3 className='text-xl font-bold mb-2'>Card 1 Title</h3>
<p>Card 1 Content</p>
</Card>
</div>
</div>
</section>
);
};

export default SectionWithCards;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job.

1 change: 1 addition & 0 deletions src/layout/Layout.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Footer from "@/components/footer/Footer";
import SectionWithCards from "@/components/marketing-card/SectionWithCards";
import Navbar from "@/components/navbar/Navbar";

export default function Layout({ children }) {
Expand Down
Loading