Skip to content

Commit a2c5a21

Browse files
committed
fixed components
1 parent aad64ec commit a2c5a21

File tree

17 files changed

+97
-6
lines changed

17 files changed

+97
-6
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/challanges/02-tours/Tours.jsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useEffect, useState } from "react";
22
import Loading from "./Loading";
33
import Tour from "./Tour";
4+
import TitlePage from "../../components/TitlePage";
45

56
const url = "https://course-api.com/react-tours-project";
67

@@ -53,9 +54,7 @@ export default function Tours() {
5354

5455
return (
5556
<div className={backgroundClass}>
56-
<h1 className="text-gray-800 text-4xl font-bold text-center mb-20 relative before:content-[''] before:absolute before:-bottom-4 before:left-0 before:right-0 before:mx-auto before:w-1/10 before:h-1 before:bg-blue-400">
57-
Our Tours
58-
</h1>
57+
<TitlePage title="our tours" />
5958
<div className="grid grid-cols-3 gap-5">
6059
{dataTours.map((tour) => (
6160
<Tour key={tour.id} {...tour} handleDelete={handleDelete} />

src/challanges/03-reviews/Reviews.jsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { FaAngleRight } from "react-icons/fa6";
33
import { FaAngleLeft } from "react-icons/fa6";
44
import { FaQuoteRight } from "react-icons/fa6";
55
import reviews from "./data";
6+
import TitlePage from "../../components/TitlePage";
67
const backgroundClass = "bg-blue-50 min-h-screen py-10 px-10";
78

89
export default function Reviews() {
@@ -32,9 +33,7 @@ export default function Reviews() {
3233

3334
return (
3435
<div className={backgroundClass}>
35-
<h1 className="text-gray-800 text-4xl font-bold text-center capitalize mb-10 relative before:content-[''] before:absolute before:-bottom-4 before:left-0 before:right-0 before:mx-auto before:w-1/10 before:h-1 before:bg-blue-400">
36-
our reviews
37-
</h1>
36+
<TitlePage title="our reviews" />
3837
<div className="w-1/2 mx-auto p-5 bg-white rounded-md shadow-2xl flex flex-col items-center">
3938
<div className="relative">
4039
<img

src/challanges/06-menu/Menu.jsx

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function Menu() {
2+
return <div>Menu</div>;
3+
}

src/challanges/06-menu/data.js

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
const menu = [
2+
{
3+
id: 1,
4+
title: "buttermilk pancakes",
5+
category: "breakfast",
6+
price: 15.99,
7+
img: "./images/item-1.jpeg",
8+
desc: `I'm baby woke mlkshk wolf bitters live-edge blue bottle, hammock freegan copper mug whatever cold-pressed `,
9+
},
10+
{
11+
id: 2,
12+
title: "diner double",
13+
category: "lunch",
14+
price: 13.99,
15+
img: "./images/item-2.jpeg",
16+
desc: `vaporware iPhone mumblecore selvage raw denim slow-carb leggings gochujang helvetica man braid jianbing. Marfa thundercats `,
17+
},
18+
{
19+
id: 3,
20+
title: "godzilla milkshake",
21+
category: "shakes",
22+
price: 6.99,
23+
img: "./images/item-3.jpeg",
24+
desc: `ombucha chillwave fanny pack 3 wolf moon street art photo booth before they sold out organic viral.`,
25+
},
26+
{
27+
id: 4,
28+
title: "country delight",
29+
category: "breakfast",
30+
price: 20.99,
31+
img: "./images/item-4.jpeg",
32+
desc: `Shabby chic keffiyeh neutra snackwave pork belly shoreditch. Prism austin mlkshk truffaut, `,
33+
},
34+
{
35+
id: 5,
36+
title: "egg attack",
37+
category: "lunch",
38+
price: 22.99,
39+
img: "./images/item-5.jpeg",
40+
desc: `franzen vegan pabst bicycle rights kickstarter pinterest meditation farm-to-table 90's pop-up `,
41+
},
42+
{
43+
id: 6,
44+
title: "oreo dream",
45+
category: "shakes",
46+
price: 18.99,
47+
img: "./images/item-6.jpeg",
48+
desc: `Portland chicharrones ethical edison bulb, palo santo craft beer chia heirloom iPhone everyday`,
49+
},
50+
{
51+
id: 7,
52+
title: "bacon overflow",
53+
category: "breakfast",
54+
price: 8.99,
55+
img: "./images/item-7.jpeg",
56+
desc: `carry jianbing normcore freegan. Viral single-origin coffee live-edge, pork belly cloud bread iceland put a bird `,
57+
},
58+
{
59+
id: 8,
60+
title: "american classic",
61+
category: "lunch",
62+
price: 12.99,
63+
img: "./images/item-8.jpeg",
64+
desc: `on it tumblr kickstarter thundercats migas everyday carry squid palo santo leggings. Food truck truffaut `,
65+
},
66+
{
67+
id: 9,
68+
title: "quarantine buddy",
69+
category: "shakes",
70+
price: 16.99,
71+
img: "./images/item-9.jpeg",
72+
desc: `skateboard fam synth authentic semiotics. Live-edge lyft af, edison bulb yuccie crucifix microdosing.`,
73+
},
74+
];
75+
export default menu;

src/components/TitlePage.jsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function TitlePage({ title }) {
2+
return (
3+
<h1 className="text-gray-800 text-4xl font-bold text-center capitalize mb-10 relative before:content-[''] before:absolute before:-bottom-4 before:left-0 before:right-0 before:mx-auto before:w-1/10 before:h-1 before:bg-blue-400">
4+
{title}
5+
</h1>
6+
);
7+
}

src/routes/router.jsx

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Tours from "../challanges/02-tours/Tours";
55
import Reviews from "../challanges/03-reviews/reviews";
66
import Accordion from "../challanges/04-accordion-I/Accordion";
77
import AccordionII from "../challanges/05-accordion-II/AccordionII";
8+
import Menu from "../challanges/06-menu/Menu";
89

910
const router = createBrowserRouter([
1011
{
@@ -32,6 +33,10 @@ const router = createBrowserRouter([
3233
path: "/accordion-II",
3334
element: <AccordionII />,
3435
},
36+
{
37+
path: "/menu",
38+
element: <Menu />,
39+
},
3540
]);
3641

3742
export default router;

src/sections/home/Home.jsx

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export default function Home() {
1818
<Link to="/accordion-II" className="underline text-blue-500">
1919
Accordion II
2020
</Link>
21+
<Link to="/menu" className="underline text-blue-500">
22+
Menu
23+
</Link>
2124
</div>
2225
);
2326
}

0 commit comments

Comments
 (0)