-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
c0a7798
commit 6245291
Showing
4 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/components/SearchFromHome/SearchHome/HotForTrip/HotForTrip.module.scss
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,14 @@ | ||
@use '@/sass' as *; | ||
|
||
.container { | ||
width: 100%; | ||
height: 100%; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
gap: 32px; | ||
|
||
overflow: scroll; | ||
|
||
padding: 0 20px 24px 20px; | ||
} |
34 changes: 34 additions & 0 deletions
34
src/components/SearchFromHome/SearchHome/HotForTrip/HotForTrip.tsx
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,34 @@ | ||
import {useEffect, useState} from 'react'; | ||
|
||
import styles from './HotForTrip.module.scss'; | ||
|
||
import {keywordSearch} from '@/api/search'; | ||
|
||
import SearchItem from '../../SearchList/SearchItem/SearchItem'; | ||
|
||
import {ForSearchType, SearchItemType} from '@/types/home'; | ||
|
||
interface PropsType { | ||
forSearch: ForSearchType; | ||
} | ||
|
||
function HotForTrip({forSearch}: PropsType) { | ||
const [data, setData] = useState<SearchItemType[]>(); | ||
|
||
async function getData() { | ||
const fetchData = await keywordSearch('문화관광축제', '전국', '인기순', 1, 10); | ||
setData(fetchData); | ||
} | ||
|
||
useEffect(() => { | ||
getData(); | ||
}, []); | ||
|
||
return ( | ||
<div className={styles.container}> | ||
{data && data.map((data) => <SearchItem data={data} forSearch={forSearch} key={data.id} />)} | ||
</div> | ||
); | ||
} | ||
|
||
export default HotForTrip; |
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