Skip to content

Commit a4113e8

Browse files
DarinHajouswoocn
andauthored
Feat/implement search bar mapcenter (#167)
* Declare leaflet-control-geocoder in type definitions * Refactor SearchBar to accept onSearch and placeholder as props * Integrate SearchBar component into MapCenter with geocoding functionality * Add default placeholder text to SearchBar component * Use dynamic translation keys for search text in MapCenter * Improve error handling with optional chaining in error response * Introduce placeholder text for search bar in Map Center across all translation files * Set map reference using whenCreated in MapContainer * Update Map Setup to Fix Type Error * Misc PR adjustments; placeholder mapping; cleanup. --------- Co-authored-by: Darin Hajou <[email protected]> Co-authored-by: swoocn <[email protected]>
1 parent 613c4bd commit a4113e8

File tree

12 files changed

+254
-72
lines changed

12 files changed

+254
-72
lines changed

messages/en-GB.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
}
199199
},
200200
"MAP_CENTER": {
201+
"SEARCH_BAR_PLACEHOLDER": "Search a location, city, or address",
201202
"VALIDATION": {
202203
"SEARCH_CENTER_SUCCESS_MESSAGE": "Your Search Centre has been saved successfully"
203204
}

messages/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
}
198198
},
199199
"MAP_CENTER": {
200+
"SEARCH_BAR_PLACEHOLDER": "Search a location, city, or address",
200201
"VALIDATION": {
201202
"SEARCH_CENTER_SUCCESS_MESSAGE": "Your Search Center has been saved successfully"
202203
}

messages/es.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@
197197
}
198198
},
199199
"MAP_CENTER": {
200+
"SEARCH_BAR_PLACEHOLDER": "Buscar una ubicación, ciudad o dirección",
200201
"VALIDATION": {
201-
"SEARCH_CENTER_SUCCESS_MESSAGE": "Tu Centro de Búsqueda se ha guardado exitosamente"
202+
"SEARCH_CENTER_SUCCESS_MESSAGE": "Tu centro de búsqueda se ha guardado correctamente"
202203
}
203204
},
204205
"LOADING_SCREEN_MESSAGE": "Cargando datos...",

messages/ewe-BJ.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@
197197
}
198198
},
199199
"MAP_CENTER": {
200+
"SEARCH_BAR_PLACEHOLDER": "Nemo wuri, gari ko adireshi",
200201
"VALIDATION": {
201-
"SEARCH_CENTER_SUCCESS_MESSAGE": "Wòɖeɖeɖe gbãtɔwo le mɔ be yé kpɔ̃ nɔ"
202+
"SEARCH_CENTER_SUCCESS_MESSAGE": "Nye dzi tsɔtɔ wɔm o"
202203
}
203204
},
204205
"LOADING_SCREEN_MESSAGE": "Ɣe siwo...",

messages/ko.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
}
198198
},
199199
"MAP_CENTER": {
200+
"SEARCH_BAR_PLACEHOLDER": "위치, 도시 또는 주소 검색",
200201
"VALIDATION": {
201202
"SEARCH_CENTER_SUCCESS_MESSAGE": "검색 센터가 성공적으로 저장되었습니다"
202203
}

package-lock.json

Lines changed: 148 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
"@pinetwork-js/sdk": "^0.7.0",
2222
"@sentry/browser": "^8.26.0",
2323
"@sentry/nextjs": "^8.26.0",
24-
"@sentry/node": "^8.26.0",
25-
"axios": "^1.7.2",
24+
"@sentry/node": "^8.27.0",
25+
"axios": "^1.7.5",
2626
"clsx": "^2.1.1",
2727
"cookies-next": "^4.1.1",
2828
"date-fns": "^3.6.0",
2929
"date-fns-tz": "^3.1.3",
3030
"i18next": "^23.11.3",
3131
"js-cookie": "^3.0.5",
3232
"leaflet": "^1.9.4",
33+
"leaflet-control-geocoder": "^2.4.0",
3334
"leaflet-geosearch": "^3.11.1",
3435
"loglevel": "^1.9.1",
3536
"next": "^14.2.4",

src/app/[locale]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default function Index() {
7676
return (
7777
<>
7878
<DynamicMap center={[mapCenter.lat, mapCenter.lng]} zoom={zoomLevel} />
79-
<SearchBar />
79+
<SearchBar page={'default'} />
8080
<div className="absolute bottom-8 z-10 flex justify-between gap-[22px] px-6 right-0 left-0 m-auto">
8181
<Link href="/seller/registration">
8282
<Button

0 commit comments

Comments
 (0)