diff --git a/src/components/GlobalNavigationBar/GlobalNavigationBar.tsx b/src/components/GlobalNavigationBar/GlobalNavigationBar.tsx index 511232bb..7e95d2cc 100644 --- a/src/components/GlobalNavigationBar/GlobalNavigationBar.tsx +++ b/src/components/GlobalNavigationBar/GlobalNavigationBar.tsx @@ -15,12 +15,11 @@ function GlobalNavigationBar() { - + - diff --git a/src/components/Home/TripSpaceAtHome/NullTrip/NullTrip.module.scss b/src/components/Home/TripSpaceAtHome/NullTrip/NullTrip.module.scss index 95cc2045..c81ff61e 100644 --- a/src/components/Home/TripSpaceAtHome/NullTrip/NullTrip.module.scss +++ b/src/components/Home/TripSpaceAtHome/NullTrip/NullTrip.module.scss @@ -13,6 +13,8 @@ border: 1px solid $neutral200; border-radius: 1.6rem; + cursor: pointer; + .img_box { position: relative; diff --git a/src/components/Home/TripSpaceAtHome/TripSpaceItem/TripSpaceItem.module.scss b/src/components/Home/TripSpaceAtHome/TripSpaceItem/TripSpaceItem.module.scss index 52722c14..422c77d1 100644 --- a/src/components/Home/TripSpaceAtHome/TripSpaceItem/TripSpaceItem.module.scss +++ b/src/components/Home/TripSpaceAtHome/TripSpaceItem/TripSpaceItem.module.scss @@ -13,6 +13,8 @@ border: 1px solid $neutral200; border-radius: 1.6rem; + cursor: pointer; + .img_box { position: relative; diff --git a/src/components/Home/VoteAtHome/VoteAtHome.tsx b/src/components/Home/VoteAtHome/VoteAtHome.tsx index cc39930f..f33b1bbe 100644 --- a/src/components/Home/VoteAtHome/VoteAtHome.tsx +++ b/src/components/Home/VoteAtHome/VoteAtHome.tsx @@ -25,7 +25,7 @@ function VoteAtHome() {
{userData && data && data.voteResponse.length > 0 ? (

- {userData} 님 + {userData}님
진행 중인 투표가 있어요!

diff --git a/src/pages/Wishes/Wishes.tsx b/src/pages/Wishes/Wishes.tsx index 6abddc46..30bf1183 100644 --- a/src/pages/Wishes/Wishes.tsx +++ b/src/pages/Wishes/Wishes.tsx @@ -11,6 +11,7 @@ import WishesHeader from '@/components/WishItem/WishesHeader/WishesHeader'; import {getUserWishes} from '@/api/wishes'; import SearchNull from '@/assets/homeIcons/search/searchNull.svg?react'; +import {translateLocation} from '@/utils/translateSearchData'; import WishItem from '../../components/WishItem/WishItem'; @@ -74,6 +75,31 @@ function Wishes() { getUserWishes(setData); }, []); + function filterLocation(location: string, data: SearchItemType[]) { + if (location.split(' ')[0] === '전국') { + return data; + } + const currentLocation = translateLocation(location); + const filterData: SearchItemType[] = []; + data.map((data) => { + console.log( + data.location.areaCode, + data.location.sigunguCode, + currentLocation.areaCode, + currentLocation.sigunguCode, + ); + + if (data.location.areaCode === currentLocation.areaCode) { + if (currentLocation.sigunguCode === 0) { + filterData.push(data); + } else if (data.location.sigunguCode === currentLocation.sigunguCode) { + filterData.push(data); + } + } + }); + return filterData; + } + useEffect(() => { if (data) { if (filter.category !== 0) { @@ -83,12 +109,16 @@ function Wishes() { } else { filterData = data.places.filter((data) => data.contentTypeId === filter.category); } + if (filter.location !== '전국') { + filterData = filterLocation(filter.location, filterData); + } setFilterData(filterData); } else { - setFilterData(data.places); + const filterData = filterLocation(filter.location, data.places); + setFilterData(filterData); } } - }, [data, filter.category]); + }, [data, filter.category, filter.location]); return (