Skip to content

Commit e15f0c3

Browse files
sublime247respp
authored andcommitted
feat: implement dynamic searchbar with location, date, and guests filters [#198]
1 parent 8a99e07 commit e15f0c3

6 files changed

Lines changed: 474 additions & 196 deletions

File tree

apps/web/public/mock-data.ts

Lines changed: 116 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
1818
location: 'Luján, Buenos Aires',
1919
price: 2500,
2020
images: [
21-
'/images/house1.jpg',
22-
'/images/house2.jpg',
23-
'/images/house3.jpg',
24-
'/images/house4.jpg',
21+
'/images/house1.webp',
22+
'/images/house2.webp',
23+
'/images/house3.webp',
24+
'/images/house4.webp',
2525
],
2626
rating: 4.1,
2727
maxGuests: 4,
@@ -35,10 +35,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
3535
location: 'Mendoza, Argentina',
3636
price: 6000,
3737
images: [
38-
'/images/house2.jpg',
39-
'/images/house3.jpg',
40-
'/images/house4.jpg',
41-
'/images/house5.jpg',
38+
'/images/house2.webp',
39+
'/images/house3.webp',
40+
'/images/house4.webp',
41+
'/images/house5.webp',
4242
],
4343
rating: 4.8,
4444
maxGuests: 8,
@@ -51,7 +51,12 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
5151
title: 'Cozy Bedroom Suite',
5252
location: 'Rosario, Santa Fe',
5353
price: 4500,
54-
images: ['/images/house3.jpg', '/images/house1.jpg', '/images/house4.jpg', '/images/house.jpg'],
54+
images: [
55+
'/images/house3.webp',
56+
'/images/house1.webp',
57+
'/images/house4.webp',
58+
'/images/house.webp',
59+
],
5560
rating: 3.9,
5661
maxGuests: 7,
5762
bedrooms: 4,
@@ -64,10 +69,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
6469
location: 'Luján, Buenos Aires',
6570
price: 5600,
6671
images: [
67-
'/images/house4.jpg',
68-
'/images/house1.jpg',
69-
'/images/house2.jpg',
70-
'/images/house3.jpg',
72+
'/images/house4.webp',
73+
'/images/house1.webp',
74+
'/images/house2.webp',
75+
'/images/house3.webp',
7176
],
7277
rating: 4.5,
7378
maxGuests: 10,
@@ -81,10 +86,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
8186
location: 'Luján, Buenos Aires',
8287
price: 2100,
8388
images: [
84-
'/images/house5.jpg',
85-
'/images/house1.jpg',
86-
'/images/house2.jpg',
87-
'/images/house3.jpg',
89+
'/images/house5.webp',
90+
'/images/house1.webp',
91+
'/images/house2.webp',
92+
'/images/house3.webp',
8893
],
8994
rating: 4.2,
9095
maxGuests: 14,
@@ -97,7 +102,12 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
97102
title: 'Modern Architectural House',
98103
location: 'Córdoba, Argentina',
99104
price: 6500,
100-
images: ['/images/house.jpg', '/images/house1.jpg', '/images/house2.jpg', '/images/house3.jpg'],
105+
images: [
106+
'/images/house.webp',
107+
'/images/house1.webp',
108+
'/images/house2.webp',
109+
'/images/house3.webp',
110+
],
101111
rating: 4.7,
102112
maxGuests: 2,
103113
bedrooms: 1,
@@ -109,7 +119,12 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
109119
title: 'Cozy kitchen home with garden view',
110120
location: 'San Isidro, Buenos Aires',
111121
price: 2500,
112-
images: ['/images/house.jpg', '/images/house2.jpg', '/images/house3.jpg', '/images/house4.jpg'],
122+
images: [
123+
'/images/house.webp',
124+
'/images/house2.webp',
125+
'/images/house3.webp',
126+
'/images/house4.webp',
127+
],
113128
rating: 4.1,
114129
maxGuests: 6,
115130
bedrooms: 2,
@@ -121,7 +136,12 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
121136
title: 'Rustic Country Bungalow',
122137
location: 'Palermo, Buenos Aires',
123138
price: 3100,
124-
images: ['/images/house1.jpg', '/images/house4.jpg', '/images/house2.jpg', '/images/house.jpg'],
139+
images: [
140+
'/images/house1.webp',
141+
'/images/house4.webp',
142+
'/images/house2.webp',
143+
'/images/house.webp',
144+
],
125145
rating: 4.3,
126146
maxGuests: 10,
127147
bedrooms: 5,
@@ -134,10 +154,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
134154
location: 'Luján, Buenos Aires',
135155
price: 3900,
136156
images: [
137-
'/images/house2.jpg',
138-
'/images/house3.jpg',
139-
'/images/property-1.jpg',
140-
'/images/house1.jpg',
157+
'/images/house2.webp',
158+
'/images/house3.webp',
159+
'/images/house5.webp',
160+
'/images/house1.webp',
141161
],
142162
rating: 4.0,
143163
maxGuests: 12,
@@ -151,10 +171,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
151171
location: 'Rosario, Santa Fe',
152172
price: 7000,
153173
images: [
154-
'/images/house5.jpg',
155-
'/images/house1.jpg',
156-
'/images/house4.jpg',
157-
'/images/house2.jpg',
174+
'/images/house5.webp',
175+
'/images/house1.webp',
176+
'/images/house4.webp',
177+
'/images/house2.webp',
158178
],
159179
rating: 4.9,
160180
maxGuests: 6,
@@ -167,7 +187,12 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
167187
title: 'Downtown Artist’s Loft',
168188
location: 'Mendoza, Argentina',
169189
price: 3300,
170-
images: ['/images/house3.jpg', '/images/house.jpg', '/images/house2.jpg', '/images/house5.jpg'],
190+
images: [
191+
'/images/house3.webp',
192+
'/images/house.webp',
193+
'/images/house2.webp',
194+
'/images/house5.webp',
195+
],
171196
rating: 3.8,
172197
maxGuests: 13,
173198
bedrooms: 8,
@@ -180,10 +205,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
180205
location: 'Rosario, Santa Fe',
181206
price: 4200,
182207
images: [
183-
'/images/house4.jpg',
184-
'/images/property-1.jpg',
185-
'/images/house1.jpg',
186-
'/images/house2.jpg',
208+
'/images/house4.webp',
209+
'/images/house5.webp',
210+
'/images/house1.webp',
211+
'/images/house2.webp',
187212
],
188213
rating: 4.4,
189214
maxGuests: 4,
@@ -196,7 +221,12 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
196221
title: 'Smart Home with Modern Tech',
197222
location: 'Córdoba, Argentina',
198223
price: 4800,
199-
images: ['/images/house.jpg', '/images/house2.jpg', '/images/house3.jpg', '/images/house4.jpg'],
224+
images: [
225+
'/images/house.webp',
226+
'/images/house2.webp',
227+
'/images/house3.webp',
228+
'/images/house4.webp',
229+
],
200230
rating: 4.6,
201231
maxGuests: 3,
202232
bedrooms: 3,
@@ -209,10 +239,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
209239
location: 'San Isidro, Buenos Aires',
210240
price: 1900,
211241
images: [
212-
'/images/house5.jpg',
213-
'/images/house1.jpg',
214-
'/images/house4.jpg',
215-
'/images/house3.jpg',
242+
'/images/house5.webp',
243+
'/images/house1.webp',
244+
'/images/house4.webp',
245+
'/images/house3.webp',
216246
],
217247
rating: 3.5,
218248
maxGuests: 2,
@@ -226,10 +256,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
226256
location: 'Luján, Buenos Aires',
227257
price: 5300,
228258
images: [
229-
'/images/house2.jpg',
230-
'/images/house.jpg',
231-
'/images/property-1.jpg',
232-
'/images/house4.jpg',
259+
'/images/house2.webp',
260+
'/images/house.webp',
261+
'/images/house5.webp',
262+
'/images/house4.webp',
233263
],
234264
rating: 4.7,
235265
maxGuests: 3,
@@ -243,10 +273,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
243273
location: 'Córdoba, Argentina',
244274
price: 2750,
245275
images: [
246-
'/images/house3.jpg',
247-
'/images/house4.jpg',
248-
'/images/house5.jpg',
249-
'/images/house1.jpg',
276+
'/images/house3.webp',
277+
'/images/house4.webp',
278+
'/images/house5.webp',
279+
'/images/house1.webp',
250280
],
251281
rating: 4.1,
252282
maxGuests: 9,
@@ -260,10 +290,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
260290
location: 'Luján, Buenos Aires',
261291
price: 2300,
262292
images: [
263-
'/images/house1.jpg',
264-
'/images/house5.jpg',
265-
'/images/house3.jpg',
266-
'/images/house2.jpg',
293+
'/images/house1.webp',
294+
'/images/house5.webp',
295+
'/images/house3.webp',
296+
'/images/house2.webp',
267297
],
268298
rating: 3.9,
269299
maxGuests: 6,
@@ -276,7 +306,12 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
276306
title: 'Stylish Loft with Workspace',
277307
location: 'San Isidro, Buenos Aires',
278308
price: 3700,
279-
images: ['/images/house2.jpg', '/images/house3.jpg', '/images/house4.jpg', '/images/house.jpg'],
309+
images: [
310+
'/images/house2.webp',
311+
'/images/house3.webp',
312+
'/images/house4.webp',
313+
'/images/house.webp',
314+
],
280315
rating: 4.2,
281316
maxGuests: 7,
282317
bedrooms: 4,
@@ -288,7 +323,12 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
288323
title: 'Luxury Farm House',
289324
location: 'Mendoza, Argentina',
290325
price: 7200,
291-
images: ['/images/house.jpg', '/images/house5.jpg', '/images/house2.jpg', '/images/house3.jpg'],
326+
images: [
327+
'/images/house.webp',
328+
'/images/house5.webp',
329+
'/images/house2.webp',
330+
'/images/house3.webp',
331+
],
292332
rating: 4.9,
293333
maxGuests: 1,
294334
bedrooms: 1,
@@ -301,10 +341,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
301341
location: 'Palermo, Buenos Aires',
302342
price: 3200,
303343
images: [
304-
'/images/house4.jpg',
305-
'/images/property-1.jpg',
306-
'/images/house1.jpg',
307-
'/images/house5.jpg',
344+
'/images/house4.webp',
345+
'/images/house5.webp',
346+
'/images/house1.webp',
347+
'/images/house5.webp',
308348
],
309349
rating: 4.3,
310350
maxGuests: 2,
@@ -318,10 +358,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
318358
location: 'Luján, Buenos Aires',
319359
price: 3100,
320360
images: [
321-
'/images/house1.jpg',
322-
'/images/house2.jpg',
323-
'/images/house3.jpg',
324-
'/images/house4.jpg',
361+
'/images/house1.webp',
362+
'/images/house2.webp',
363+
'/images/house3.webp',
364+
'/images/house4.webp',
325365
],
326366
rating: 4.0,
327367
maxGuests: 2,
@@ -335,10 +375,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
335375
location: 'Córdoba, Argentina',
336376
price: 4100,
337377
images: [
338-
'/images/house5.jpg',
339-
'/images/house2.jpg',
340-
'/images/house4.jpg',
341-
'/images/house3.jpg',
378+
'/images/house5.webp',
379+
'/images/house2.webp',
380+
'/images/house4.webp',
381+
'/images/house3.webp',
342382
],
343383
rating: 4.2,
344384
maxGuests: 5,
@@ -352,10 +392,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
352392
location: 'Mendoza, Argentina',
353393
price: 2990,
354394
images: [
355-
'/images/house3.jpg',
356-
'/images/house2.jpg',
357-
'/images/house1.jpg',
358-
'/images/house5.jpg',
395+
'/images/house3.webp',
396+
'/images/house2.webp',
397+
'/images/house1.webp',
398+
'/images/house5.webp',
359399
],
360400
rating: 3.7,
361401
maxGuests: 3,
@@ -369,10 +409,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
369409
location: 'Rosario, Santa Fe',
370410
price: 5200,
371411
images: [
372-
'/images/house.jpg',
373-
'/images/house2.jpg',
374-
'/images/house4.jpg',
375-
'/images/property-1.jpg',
412+
'/images/house.webp',
413+
'/images/house2.webp',
414+
'/images/house4.webp',
415+
'/images/house5.webp',
376416
],
377417
rating: 4.6,
378418
maxGuests: 8,
@@ -386,10 +426,10 @@ export const MOCK_PROPERTIES: FullPropertyProps[] = [
386426
location: 'Luján, Buenos Aires',
387427
price: 5800,
388428
images: [
389-
'/images/house1.jpg',
390-
'/images/house5.jpg',
391-
'/images/house4.jpg',
392-
'/images/house3.jpg',
429+
'/images/house1.webp',
430+
'/images/house5.webp',
431+
'/images/house4.webp',
432+
'/images/house3.webp',
393433
],
394434
rating: 4.5,
395435
maxGuests: 3,

apps/web/src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { SearchBar } from '@/components/features/search/SearchBar';
22
import { RightSidebar } from '@/components/layout/RightSidebar';
3-
import { PropertyGrid } from '@/components/search/PropertyGrid';
3+
import PropertyGrid from '@/components/search/PropertyGrid';
44
import { House } from 'lucide-react';
55
import Image from 'next/image';
66
import { Suspense } from 'react';
@@ -9,7 +9,7 @@ export default function Home() {
99
return (
1010
<div className="flex w-full min-h-screen">
1111
<main className="flex flex-1 flex-col w-full min-h-screen px-5 pr-16">
12-
<header className="flex items-center justify-between p-4 border-b border-gray-800"></header>
12+
<header className="flex items-center justify-between p-4 border-b border-gray-800" />
1313

1414
<section className="p-4">
1515
<SearchBar />

0 commit comments

Comments
 (0)