-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
107 additions
and
5 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ButtonWhite } from '@components/common/button/Button'; | ||
import { ResultItem } from './ResultItem'; | ||
|
||
export const ResultCategory = () => { | ||
return ( | ||
<> | ||
<h2 className="headline2 my-2.5">숙소</h2> | ||
<ResultItem /> | ||
<ResultItem /> | ||
<ButtonWhite className="my-2" onClick={() => {}}> | ||
숙소 더 보기 | ||
</ButtonWhite> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const ResultItem = () => { | ||
return ( | ||
<div className="flex h-[52px] w-full py-1.5"> | ||
<div className="imgWrap mr-2.5 overflow-hidden rounded-lg"> | ||
<img | ||
className="h-10 w-10 object-cover" | ||
src="https://source.unsplash.com/random" | ||
alt="" | ||
/> | ||
</div> | ||
<div className="textWrap flex flex-col justify-between py-0.5"> | ||
<div className="name body3">강릉 세인트존스 호텔</div> | ||
<span className="address body6 text-gray4">강원 강릉시 창해로 307</span> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ResultCategory } from './ResultCategory'; | ||
|
||
export const SearchResult = () => { | ||
return ( | ||
<> | ||
<div className="tabs">전체 숙소 식당 관광지</div> | ||
<ResultCategory /> | ||
<ResultCategory /> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
import { RegionSelect } from '@components/search/RegionSelect'; | ||
import { SearchInput } from '@components/search/SearchInput'; | ||
import { SearchResult } from '@components/search/SearchResult'; | ||
import { useState } from 'react'; | ||
|
||
export const Search = () => { | ||
const [searchValue, setSearchValue] = useState(''); | ||
const [selectedRegion, setSelectedRegion] = useState(''); | ||
|
||
const handleRegionChange = (selectedRegion: string | number) => { | ||
console.log('선택한 지역:', selectedRegion); | ||
setSelectedRegion(selectedRegion.toString()); | ||
setSearchValue(selectedRegion.toString()); | ||
}; | ||
|
||
const handleInputChange = (value: string) => { | ||
setSearchValue(value); | ||
}; | ||
|
||
return ( | ||
<> | ||
<SearchInput /> | ||
<RegionSelect onRegionChange={handleRegionChange} /> | ||
<SearchInput | ||
onInputChange={handleInputChange} | ||
selectedRegion={selectedRegion} | ||
/> | ||
{searchValue ? ( | ||
<SearchResult /> | ||
) : ( | ||
<RegionSelect onRegionChange={handleRegionChange} /> | ||
)} | ||
</> | ||
); | ||
}; |