-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmarketplace.js
154 lines (145 loc) · 3.69 KB
/
marketplace.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
"use client";
import Head from 'next/head';
import Navbar from '../components/Navbar'; // Adjust the import path if necessary
import Footer from '../components/Footer'; // Adjust the import path if necessary
import Card from '../components/card'; // Ensure the correct path to the Card component
const products = [
{
image: 'https://via.placeholder.com/300',
description: 'Stylish Chair',
price: 99.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Modern Sofa',
price: 299.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Wooden Table',
price: 149.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Classic Lamp',
price: 59.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Bookshelf',
price: 199.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Modern Desk',
price: 249.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Comfy Armchair',
price: 129.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Elegant Bed',
price: 399.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Dining Set',
price: 499.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Office Chair',
price: 149.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Stylish Chair',
price: 99.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Modern Sofa',
price: 299.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Wooden Table',
price: 149.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Classic Lamp',
price: 59.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Bookshelf',
price: 199.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Modern Desk',
price: 249.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Comfy Armchair',
price: 129.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Elegant Bed',
price: 399.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Dining Set',
price: 499.99,
},
{
image: 'https://via.placeholder.com/300',
description: 'Office Chair',
price: 149.99,
},
];
const Home = () => {
const handleBuyNow = (product) => {
alert(`Buying ${product.description} for $${product.price}`);
};
return (
<>
<div className="min-h-screen flex flex-col" style={{ backgroundColor: '#135D66' }}>
<Head>
<title>Furniture Website</title>
<meta name="description" content="Furniture marketplace and categories" />
</Head>
<Navbar />
<main className="flex-grow p-4">
<div className='text-center mb-8'>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4">
{products.map((product, index) => (
<Card
key={index}
image={product.image}
description={product.description}
price={product.price}
onBuyNow={() => handleBuyNow(product)}
/>
))}
</div>
<div>
<button className='w-screen h-15 my-10 bg-gray-900 shadow text-white px-4 py-2 rounded-lg'>
Back to home
</button>
</div>
</main>
<Footer />
</div>
</>
);
};
export default Home;