Skip to content

Commit b10cc28

Browse files
committed
feat: Add lazy loading for images and improve location input handling
1 parent d7fb5f0 commit b10cc28

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pages/AboutMePage.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ const AboutMePage = () => {
209209
<h3>Home Address</h3>
210210
<input
211211
className="address-input"
212-
type="text"
212+
type="search"
213213
placeholder="Enter Home Address"
214+
enterKeyHint="search"
214215
value={locationInputHome}
215216
onChange={handleHomeLocationChange}
216217
onKeyUp={e => handleSearchBox(e, 1)}
@@ -239,8 +240,9 @@ const AboutMePage = () => {
239240
<h3>Work Address</h3>
240241
<input
241242
className="address-input"
242-
type="text"
243+
type="search"
243244
placeholder="Enter Work Address"
245+
enterKeyHint="search"
244246
value={locationInputWork}
245247
onChange={handleWorkLocationChange}
246248
onKeyUp={e => handleSearchBox(e, 2)}

pages/Home.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import WindSpeedIcon from '../src/assets/WindSpeedIcon.svg'
4444
import SearchIcon from '../src/assets/search-icon.svg'
4545
import AIIcon from '../src/assets/ai-icon.svg'
4646
import SendBtn from '../src/assets/Send-Button.svg'
47+
import { set } from 'mongoose'
4748

4849
let initialFetchDone = false
4950

@@ -336,15 +337,18 @@ const Home = () => {
336337
case 1:
337338
setLocation(locationData)
338339
fetchWeatherData(locationData.lat, locationData.lon)
340+
setLocationInput(suggestion.label)
339341
break
340342
case 2:
341343
setStartLocation(locationData)
342344
if (endLocation.lat !== 0 && endLocation.lon !== 0) {
343345
RoutingMachine(locationData, endLocation, vehicleType)
344346
}
347+
setStartLocationInput(suggestion.label)
345348
break
346349
case 3:
347350
setEndLocation(locationData)
351+
setDestinationLocationInput(suggestion.label)
348352
if (
349353
((endLocation.lat !== 0 && endLocation.lon !== 0) ||
350354
(locationData.lat !== 0 && locationData.lon !== 0)) &&

0 commit comments

Comments
 (0)