From 3e5db18c133ebf96af9b187c9362e28127cc97db Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 30 Jul 2023 15:11:04 +0900 Subject: [PATCH 01/45] =?UTF-8?q?refactor:=20TopNavigation=20=3D>=20SideNa?= =?UTF-8?q?vigation=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SideNavigation.module.scss} | 0 .../common/{TopNavigation => SideNavigation}/index.tsx | 2 +- src/layout/DefaultLayout/index.tsx | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/components/common/{TopNavigation/TopNavigation.module.scss => SideNavigation/SideNavigation.module.scss} (100%) rename src/components/common/{TopNavigation => SideNavigation}/index.tsx (96%) diff --git a/src/components/common/TopNavigation/TopNavigation.module.scss b/src/components/common/SideNavigation/SideNavigation.module.scss similarity index 100% rename from src/components/common/TopNavigation/TopNavigation.module.scss rename to src/components/common/SideNavigation/SideNavigation.module.scss diff --git a/src/components/common/TopNavigation/index.tsx b/src/components/common/SideNavigation/index.tsx similarity index 96% rename from src/components/common/TopNavigation/index.tsx rename to src/components/common/SideNavigation/index.tsx index 6409ae8a..96a3d2c3 100644 --- a/src/components/common/TopNavigation/index.tsx +++ b/src/components/common/SideNavigation/index.tsx @@ -5,7 +5,7 @@ import { ReactComponent as SettingIcon } from 'assets/svg/common/setting.svg'; import { ReactComponent as WriteIcon } from 'assets/svg/common/write.svg'; import { ReactComponent as MyPageIcon } from 'assets/svg/common/my-page.svg'; import { useAuth } from 'store/auth'; -import styles from './TopNavigation.module.scss'; +import styles from './SideNavigation.module.scss'; export default function TopNavigation(): JSX.Element { const auth = useAuth(); diff --git a/src/layout/DefaultLayout/index.tsx b/src/layout/DefaultLayout/index.tsx index f97dc39a..86c4e4ba 100644 --- a/src/layout/DefaultLayout/index.tsx +++ b/src/layout/DefaultLayout/index.tsx @@ -1,7 +1,7 @@ import { Outlet, useLocation } from 'react-router-dom'; import BottomNavigation from 'components/common/BottomNavigation'; import useMediaQuery from 'utils/hooks/useMediaQuery'; -import TopNavigation from 'components/common/TopNavigation'; +import SideNavigation from 'components/common/SideNavigation'; import Home from 'pages/Home'; import cn from 'utils/ts/classNames'; import styles from './DefaultLayout.module.scss'; @@ -11,7 +11,7 @@ export default function DefaultLayout(): JSX.Element { const location = useLocation(); return ( <> - {!isMobile && } + {!isMobile && }
From ab2a69e50d7dd73c5f6d9ee535c5378275e5aa29 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 30 Jul 2023 15:17:26 +0900 Subject: [PATCH 02/45] =?UTF-8?q?chore:=20=EB=A1=9C=EA=B3=A0,=20=EB=A9=94?= =?UTF-8?q?=EB=89=B4=20svg=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/svg/common/logo.svg | 6 ++++++ src/assets/svg/common/menu.svg | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 src/assets/svg/common/logo.svg create mode 100644 src/assets/svg/common/menu.svg diff --git a/src/assets/svg/common/logo.svg b/src/assets/svg/common/logo.svg new file mode 100644 index 00000000..0f9a7250 --- /dev/null +++ b/src/assets/svg/common/logo.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/assets/svg/common/menu.svg b/src/assets/svg/common/menu.svg new file mode 100644 index 00000000..ec36294d --- /dev/null +++ b/src/assets/svg/common/menu.svg @@ -0,0 +1,3 @@ + + + From 4c98dcb87274fa66ede3c59181698d4aa5a7fb0e Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 30 Jul 2023 15:17:57 +0900 Subject: [PATCH 03/45] =?UTF-8?q?fix:=20=EC=A7=80=EB=8F=84=20=EC=98=B5?= =?UTF-8?q?=EC=85=98,=20=ED=81=AC=EA=B8=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/components/Map/Map.module.scss | 8 ++------ src/pages/Home/components/Map/index.tsx | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/pages/Home/components/Map/Map.module.scss b/src/pages/Home/components/Map/Map.module.scss index 4455c134..f5f83869 100644 --- a/src/pages/Home/components/Map/Map.module.scss +++ b/src/pages/Home/components/Map/Map.module.scss @@ -1,12 +1,8 @@ @use "src/utils/styles/mediaQuery" as media; .map { - width: 100%; - height: calc(100vh - 81px); - - @include media.media-breakpoint-down(mobile) { - height: calc(100vh - 80px); - } + width: 100vw; + height: 100vh; } .bottom-options { diff --git a/src/pages/Home/components/Map/index.tsx b/src/pages/Home/components/Map/index.tsx index dae9ae33..d51e033d 100644 --- a/src/pages/Home/components/Map/index.tsx +++ b/src/pages/Home/components/Map/index.tsx @@ -56,11 +56,7 @@ export default function Map(): JSX.Element { if (!mapRef.current && typeof location !== 'undefined') { mapRef.current = new naver.maps.Map('map', { center: new naver.maps.LatLng(location.latitude, location.longitude), - zoomControl: true, - zoomControlOptions: { - style: naver.maps.ZoomControlStyle.SMALL, - position: naver.maps.Position.BOTTOM_LEFT, - }, + zoomControl: false, zoom: 10, scaleControl: false, logoControl: false, From 915d75757b737846777c0c4ab50f7127c6a62608 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 30 Jul 2023 15:18:42 +0900 Subject: [PATCH 04/45] =?UTF-8?q?fix:=20=EC=82=AC=EC=9D=B4=EB=93=9C?= =?UTF-8?q?=EB=B0=94=EB=A1=9C=20=EB=94=94=EC=9E=90=EC=9D=B8=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SideNavigation/SideNavigation.module.scss | 95 +++++++++------- .../common/SideNavigation/index.tsx | 102 ++++++++++++------ 2 files changed, 124 insertions(+), 73 deletions(-) diff --git a/src/components/common/SideNavigation/SideNavigation.module.scss b/src/components/common/SideNavigation/SideNavigation.module.scss index d429a660..486e38d4 100644 --- a/src/components/common/SideNavigation/SideNavigation.module.scss +++ b/src/components/common/SideNavigation/SideNavigation.module.scss @@ -1,63 +1,76 @@ @use "src/utils/styles/mediaQuery"; -.top-navigation { - width: 100%; - height: 80px; - box-shadow: 0 0 5px rgb(0 0 0 / 15%); - display: grid; - grid-template-columns: 1fr 0.7fr 1fr; - align-items: center; - font-size: 18px; +@keyframes slide-out { + from { + margin-left: -300px; + } - &__logo { - display: flex; + to { + margin-left: 0; } +} + +.side-navigation { + background-color: #ffffff; + width: 100px; + height: 100%; + position: fixed; + top: 0; + left: 0; + border-right: #c4c4c4 solid 1.5px; + display: flex; + flex-direction: column; + justify-content: space-between; + z-index: 10; - &__logo-link { - margin-left: 72px; + &__lists { display: flex; + flex-direction: column; align-items: center; - gap: 14px; - font-weight: 700; - font-size: 18px; - color: #222222; - text-decoration: none; + list-style: none; } - &__address { - cursor: pointer; + &__list { display: flex; - align-items: center; + flex-direction: column; justify-content: center; - gap: 8px; - - svg { - width: 24px; - height: 24px; + height: 100px; - path { - stroke: #222222; - } + &--clicked { + background-color: #fff1e8; } } - &__links { + &__link { display: flex; - align-items: center; - justify-content: flex-end; - gap: 48px; - margin-right: 72px; - list-style: none; - opacity: 0.8; + flex-direction: column; + text-align: center; + text-decoration: none; + color: #666666; + } + + &__button { + border: none; + background-color: transparent; + width: 100px; } + &__login { + position: relative; + bottom: 0; + } +} + +.bottom-navigation { + display: flex; + background-color: #ffffff; + height: 100px; + justify-content: center; + align-items: center; + list-style: none; + &__link { text-decoration: none; - font-weight: 500; - color: #222222; - display: flex; - align-items: center; - justify-content: center; - gap: 8px; + color: #666666; } } diff --git a/src/components/common/SideNavigation/index.tsx b/src/components/common/SideNavigation/index.tsx index 96a3d2c3..855fafa2 100644 --- a/src/components/common/SideNavigation/index.tsx +++ b/src/components/common/SideNavigation/index.tsx @@ -1,56 +1,94 @@ -import { Link } from 'react-router-dom'; -import { ReactComponent as LogoIcon } from 'assets/svg/common/favicon.svg'; -import { ReactComponent as ArrowIcon } from 'assets/svg/common/arrow.svg'; +import { ReactComponent as LogoIcon } from 'assets/svg/common/logo.svg'; import { ReactComponent as SettingIcon } from 'assets/svg/common/setting.svg'; import { ReactComponent as WriteIcon } from 'assets/svg/common/write.svg'; import { ReactComponent as MyPageIcon } from 'assets/svg/common/my-page.svg'; +import { ReactComponent as SearchIcon } from 'assets/svg/search/lens.svg'; import { useAuth } from 'store/auth'; +import cn from 'utils/ts/classNames'; +import useBooleanState from 'utils/hooks/useBooleanState'; +import { Link } from 'react-router-dom'; import styles from './SideNavigation.module.scss'; export default function TopNavigation(): JSX.Element { const auth = useAuth(); + const [visible, , , toggle] = useBooleanState(false); - const tabs = [ + const TABS = [ { - name: '설정', - icon: , - link: '/setting', + name: '', + icon: , + link: '/', + + }, + { + name: '검색', + icon: , + link: '/', + }, { name: '글쓰기', icon: , - link: '/search', + link: '/post', }, { - name: auth ? '마이페이지' : '로그인', + name: '마이페이지', icon: , link: auth ? '/profile' : '/login', }, + { + name: '설정', + icon: , + link: '/setting', + }, ]; return ( - +
+ +
); } From a438b2800f8e658e17ef87126a059c1067bbd60a Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 30 Jul 2023 15:21:13 +0900 Subject: [PATCH 05/45] =?UTF-8?q?feat:=20=EC=82=AC=EC=9D=B4=EB=93=9C?= =?UTF-8?q?=EB=B0=94=20=ED=8C=90=EB=84=AC=EC=9D=98=20=EA=B2=80=EC=83=89?= =?UTF-8?q?=EC=B0=BD=EA=B3=BC=20=EC=98=B5=EC=85=98=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SideNavigation/SideNavigation.module.scss | 74 +++++++++++++++++++ .../common/SideNavigation/index.tsx | 31 ++++++++ 2 files changed, 105 insertions(+) diff --git a/src/components/common/SideNavigation/SideNavigation.module.scss b/src/components/common/SideNavigation/SideNavigation.module.scss index 486e38d4..423f4091 100644 --- a/src/components/common/SideNavigation/SideNavigation.module.scss +++ b/src/components/common/SideNavigation/SideNavigation.module.scss @@ -74,3 +74,77 @@ color: #666666; } } + +.side-pannel { + width: 550px; + height: 100%; + position: fixed; + top: 0; + left: 100px; + z-index: 5; + background-color: #ffffff; + animation: slide-out 0.3s ease-out normal forwards; + display: flex; + flex-direction: column; + + &__search { + display: flex; + flex-direction: column; + margin: 16px 24px 24px 16px; + align-items: center; + } + + &__search-bar { + display: flex; + gap: 16px; + align-items: center; + } + + &__search-input { + width: 405px; + height: 50px; + border-radius: 100px; + border: 1.5px solid #ff7f23; + padding-left: 24px; + font-size: 18px; + font-weight: 500; + box-shadow: 2px 3px 12px 1px rgba(0 0 0 / 10%); + + &::placeholder { + color: #c4c4c4; + } + } + + &__search-icon { + position: relative; + top: 4px; + right: 40px; + + path { + stroke: #ff7f23; + } + } + + &__search-buttons { + display: flex; + gap: 8px; + margin-top: 16px; + } + + &__search-button { + border: none; + background-color: #ffffff; + font-size: 15px; + width: 145px; + height: 35px; + font-weight: 500; + color: #666666; + box-shadow: 2px 2px 5px 0 rgba(0 0 0 / 10%); + border-radius: 100px; + cursor: pointer; + + svg { + padding-left: 5px; + } + } +} diff --git a/src/components/common/SideNavigation/index.tsx b/src/components/common/SideNavigation/index.tsx index 855fafa2..669d3881 100644 --- a/src/components/common/SideNavigation/index.tsx +++ b/src/components/common/SideNavigation/index.tsx @@ -3,6 +3,10 @@ import { ReactComponent as SettingIcon } from 'assets/svg/common/setting.svg'; import { ReactComponent as WriteIcon } from 'assets/svg/common/write.svg'; import { ReactComponent as MyPageIcon } from 'assets/svg/common/my-page.svg'; import { ReactComponent as SearchIcon } from 'assets/svg/search/lens.svg'; +import { ReactComponent as MenuIcon } from 'assets/svg/common/menu.svg'; +import { ReactComponent as StoreFrontIcon } from 'assets/svg/home/storefront.svg'; +import { ReactComponent as BookMarkIcon } from 'assets/svg/home/bookmark.svg'; +import { ReactComponent as GroupIcon } from 'assets/svg/home/group.svg'; import { useAuth } from 'store/auth'; import cn from 'utils/ts/classNames'; import useBooleanState from 'utils/hooks/useBooleanState'; @@ -89,6 +93,33 @@ export default function TopNavigation(): JSX.Element { )} + {visible && ( +
+
+
+ + + + + +
+
+ + + +
+
+
+ )}
); } From fc4b1739db3bcf1a819b207cb1bf57749e37fd5d Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 30 Jul 2023 15:29:22 +0900 Subject: [PATCH 06/45] =?UTF-8?q?fix:=20=EA=B8=80=EC=93=B0=EA=B8=B0,=20?= =?UTF-8?q?=EB=A7=88=EC=9D=B4=ED=8E=98=EC=9D=B4=EC=A7=80=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20=EB=94=94=EC=9E=90?= =?UTF-8?q?=EC=9D=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BottomNavigation.module.scss | 1 + .../common/BottomNavigation/index.tsx | 38 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/components/common/BottomNavigation/BottomNavigation.module.scss b/src/components/common/BottomNavigation/BottomNavigation.module.scss index 1d4294af..260a8090 100644 --- a/src/components/common/BottomNavigation/BottomNavigation.module.scss +++ b/src/components/common/BottomNavigation/BottomNavigation.module.scss @@ -6,6 +6,7 @@ left: 0; width: 100%; height: 80px; + background-color: #ffffff; } .tab { diff --git a/src/components/common/BottomNavigation/index.tsx b/src/components/common/BottomNavigation/index.tsx index 8ad972d1..6b266025 100644 --- a/src/components/common/BottomNavigation/index.tsx +++ b/src/components/common/BottomNavigation/index.tsx @@ -3,28 +3,30 @@ import { ReactComponent as WriteIcon } from 'assets/svg/common/write.svg'; import { ReactComponent as MyPageIcon } from 'assets/svg/common/my-page.svg'; import { Link, useLocation } from 'react-router-dom'; import cn from 'utils/ts/classNames'; +import { useAuth } from 'store/auth'; import styles from './BottomNavigation.module.scss'; -const NAV_TABS = [ - { - pathname: '/', - icon: HomeIcon, - text: '홈', - }, - { - pathname: '/search', - icon: WriteIcon, - text: '글쓰기', - }, - { - pathname: '/profile', - icon: MyPageIcon, - text: '마이페이지', - }, -]; - export default function BottomNavigation(): JSX.Element { const { pathname } = useLocation(); + const auth = useAuth(); + + const NAV_TABS = [ + { + pathname: '/', + icon: HomeIcon, + text: '홈', + }, + { + pathname: '/post', + icon: WriteIcon, + text: '글쓰기', + }, + { + pathname: auth ? '/profile' : '/login', + icon: MyPageIcon, + text: '마이페이지', + }, + ]; return ( - {visible && ( -
-
-
- - - - - -
-
- - - -
+
+
+
+ + + + + +
+
+ + +
- )} +
+
); } From 7afb96cabad302fd0ee20407ba26d51bf6eee045 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Tue, 1 Aug 2023 21:29:24 +0900 Subject: [PATCH 10/45] =?UTF-8?q?refactor:=20search=20=3D>=20shop=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/search/index.ts | 8 -------- src/api/{search => shop}/entity.ts | 0 src/api/shop/index.ts | 8 ++++++++ .../{search/searchApiClient.ts => shop/shopApiClient.ts} | 6 +++--- src/pages/Search/hooks/useTrendings.ts | 2 +- src/pages/SearchDetails/hooks/useFetchShops.ts | 4 ++-- src/utils/hooks/useGeolocation.ts | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 src/api/search/index.ts rename src/api/{search => shop}/entity.ts (100%) create mode 100644 src/api/shop/index.ts rename src/api/{search/searchApiClient.ts => shop/shopApiClient.ts} (79%) diff --git a/src/api/search/index.ts b/src/api/search/index.ts deleted file mode 100644 index a874644a..00000000 --- a/src/api/search/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FetchShopsResponse, FetchTrendingsResponse, ShopsParams } from './entity'; -import searchApi from './searchApiClient'; - -export const fetchTrendings = () => searchApi.get('/trending'); - -export const fetchShop = (shopId: string) => searchApi.get(`/shop?place_id=${shopId}`); - -export const fetchShops = (params: ShopsParams) => searchApi.post(`/shops?keyword=${params.keyword}&x=${params.location?.latitude}&y=${params.location?.longitude}`); diff --git a/src/api/search/entity.ts b/src/api/shop/entity.ts similarity index 100% rename from src/api/search/entity.ts rename to src/api/shop/entity.ts diff --git a/src/api/shop/index.ts b/src/api/shop/index.ts new file mode 100644 index 00000000..47a8b499 --- /dev/null +++ b/src/api/shop/index.ts @@ -0,0 +1,8 @@ +import { FetchShopsResponse, FetchTrendingsResponse, ShopsParams } from './entity'; +import shophApi from './shopApiClient'; + +export const fetchTrendings = () => shophApi.get('/trending'); + +export const fetchShop = (shopId: string) => shophApi.get(`/shop?place_id=${shopId}`); + +export const fetchShops = (params: ShopsParams) => shophApi.post(`/shops?keyword=${params.keyword}&x=${params.location?.latitude}&y=${params.location?.longitude}`); diff --git a/src/api/search/searchApiClient.ts b/src/api/shop/shopApiClient.ts similarity index 79% rename from src/api/search/searchApiClient.ts rename to src/api/shop/shopApiClient.ts index 82054259..fa5d2cec 100644 --- a/src/api/search/searchApiClient.ts +++ b/src/api/shop/shopApiClient.ts @@ -1,12 +1,12 @@ import axios from 'axios'; import { API_PATH } from 'config/constants'; -const searchApi = axios.create({ +const shopApi = axios.create({ baseURL: `${API_PATH}`, timeout: 2000, }); -searchApi.interceptors.request.use( +shopApi.interceptors.request.use( (config) => { const accessToken = sessionStorage.getItem('accessToken'); // eslint-disable-next-line no-param-reassign @@ -15,4 +15,4 @@ searchApi.interceptors.request.use( }, ); -export default searchApi; +export default shopApi; diff --git a/src/pages/Search/hooks/useTrendings.ts b/src/pages/Search/hooks/useTrendings.ts index daef333b..15c9547b 100644 --- a/src/pages/Search/hooks/useTrendings.ts +++ b/src/pages/Search/hooks/useTrendings.ts @@ -1,4 +1,4 @@ -import { fetchTrendings } from 'api/search'; +import { fetchTrendings } from 'api/shop'; import { useQuery } from 'react-query'; const useTrendingList = () => { diff --git a/src/pages/SearchDetails/hooks/useFetchShops.ts b/src/pages/SearchDetails/hooks/useFetchShops.ts index 438efcf0..9a2558b8 100644 --- a/src/pages/SearchDetails/hooks/useFetchShops.ts +++ b/src/pages/SearchDetails/hooks/useFetchShops.ts @@ -1,7 +1,7 @@ import useGeolocation from 'utils/hooks/useGeolocation'; import { useQuery } from 'react-query'; -import { fetchShops } from 'api/search'; -import { ShopsParams } from 'api/search/entity'; +import { fetchShops } from 'api/shop'; +import { ShopsParams } from 'api/shop/entity'; const useFetchShops = (keyword: string) => { const options = { diff --git a/src/utils/hooks/useGeolocation.ts b/src/utils/hooks/useGeolocation.ts index 40833139..771f4d44 100644 --- a/src/utils/hooks/useGeolocation.ts +++ b/src/utils/hooks/useGeolocation.ts @@ -1,4 +1,4 @@ -import { Coords } from 'api/search/entity'; +import { Coords } from 'api/shop/entity'; import { useEffect, useState } from 'react'; interface Position { From b2a3fcb9202134d7f4dca030ba0a4f27d126efbf Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 6 Aug 2023 22:50:08 +0900 Subject: [PATCH 11/45] =?UTF-8?q?feat:=20=ED=95=84=ED=84=B0=20=EC=83=81?= =?UTF-8?q?=EC=A0=90=20=ED=83=80=EC=9E=85=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop/entity.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/api/shop/entity.ts b/src/api/shop/entity.ts index 4e6f0fbc..ed53eae5 100644 --- a/src/api/shop/entity.ts +++ b/src/api/shop/entity.ts @@ -1,3 +1,17 @@ +export interface FilterShopsParams { + options_friend: 0 | 1; + options_nearby: 0 | 1; + options_scrap: 0 | 1; + location?: Coords; +} + +export interface FilterShopsResponse { + geometry?: Coords; + name: string; + photo: null | string[]; + placeId: string; +} + export interface FetchTrendingsResponse { trendings: string[] } @@ -27,6 +41,6 @@ interface Shop { } export interface Coords { - latitude: number, - longitude: number + latitude: number | undefined; + longitude: number | undefined; } From 5c538172d619a89eccb44025c9ca7d1977b1f587 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 6 Aug 2023 22:50:53 +0900 Subject: [PATCH 12/45] =?UTF-8?q?feat:=20'shops/maps'=20api=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop/index.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/api/shop/index.ts b/src/api/shop/index.ts index 47a8b499..f2422ffd 100644 --- a/src/api/shop/index.ts +++ b/src/api/shop/index.ts @@ -1,8 +1,16 @@ -import { FetchShopsResponse, FetchTrendingsResponse, ShopsParams } from './entity'; -import shophApi from './shopApiClient'; +import { + Coords, + FetchShopsResponse, FetchTrendingsResponse, FilterShopsParams, FilterShopsResponse, ShopsParams, +} from './entity'; +import shopApi from './shopApiClient'; -export const fetchTrendings = () => shophApi.get('/trending'); +export const fetchTrendings = () => shopApi.get('/trending'); -export const fetchShop = (shopId: string) => shophApi.get(`/shop?place_id=${shopId}`); +export const fetchShop = (shopId: string) => shopApi.get(`/shop?place_id=${shopId}`); -export const fetchShops = (params: ShopsParams) => shophApi.post(`/shops?keyword=${params.keyword}&x=${params.location?.latitude}&y=${params.location?.longitude}`); +export const fetchShops = (params: ShopsParams) => shopApi.post(`/shops?keyword=${params.keyword}&x=${params.location?.latitude}&y=${params.location?.longitude}`); + +export const getfilterShops = (params: FilterShopsParams, location: Coords) => shopApi.post(`/shops/maps?options_friend=${params.options_friend}&options_nearby=${params.options_nearby}&options_scrap=${params.options_friend}`, { + lat: location.latitude, + lng: location.longitude, +}); From 294cbed1167e6a814f66f76369dfc5038deaf40e Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 6 Aug 2023 22:52:27 +0900 Subject: [PATCH 13/45] =?UTF-8?q?feat:=20useFilterShops=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Map/hooks/useFilterShops.ts | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/pages/Home/components/Map/hooks/useFilterShops.ts diff --git a/src/pages/Home/components/Map/hooks/useFilterShops.ts b/src/pages/Home/components/Map/hooks/useFilterShops.ts new file mode 100644 index 00000000..585db463 --- /dev/null +++ b/src/pages/Home/components/Map/hooks/useFilterShops.ts @@ -0,0 +1,33 @@ +import useGeolocation from 'utils/hooks/useGeolocation'; +import { useQuery } from 'react-query'; +import { getfilterShops } from 'api/shop'; +import { FilterShopsParams } from 'api/shop/entity'; + +const OPTIONS = { + maximumAge: 1000, +}; +const useFilterShops = ({ + options_friend, options_nearby, options_scrap, +}: FilterShopsParams) => { + const { location } = useGeolocation(OPTIONS); + const params: FilterShopsParams = { + options_friend, options_nearby, options_scrap, + }; + const { + isLoading, isError, data, refetch, + } = useQuery('filterShops', () => getfilterShops(params, { + latitude: location?.latitude, + longitude: location?.longitude, + }), { + enabled: !!(location), + }); + + const isFetching = isLoading || !(location); + const filterShops = data?.data; + + return { + isFetching, isError, data: filterShops, refetch, + }; +}; + +export default useFilterShops; From 10758afb4209ba7a33ed87a1264e896886cb4c97 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 6 Aug 2023 23:25:07 +0900 Subject: [PATCH 14/45] =?UTF-8?q?feat:=20=EC=A7=80=EB=8F=84=20=EB=B6=80?= =?UTF-8?q?=EB=B6=84=20custom-hook=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/components/Map/hooks/useNaverMap.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/pages/Home/components/Map/hooks/useNaverMap.ts diff --git a/src/pages/Home/components/Map/hooks/useNaverMap.ts b/src/pages/Home/components/Map/hooks/useNaverMap.ts new file mode 100644 index 00000000..94a92942 --- /dev/null +++ b/src/pages/Home/components/Map/hooks/useNaverMap.ts @@ -0,0 +1,30 @@ +/* eslint-disable react-hooks/exhaustive-deps */ +import { useEffect, useState } from 'react'; + +function useNaverMap(latitude: number | undefined, longitude: number | undefined) { + const [map, setMap] = useState(null); + + useEffect(() => { + if (!map && latitude && longitude) { + const newMaps = new naver.maps.Map('map', { + center: new naver.maps.LatLng(latitude, longitude), + zoomControl: false, + zoom: 10, + scaleControl: false, + logoControl: false, + mapDataControl: false, + }); + setMap(newMaps); + + return () => { + newMaps.destroy(); + }; + } + + return () => {}; + }, [latitude, longitude]); + + return map; +} + +export default useNaverMap; From df6543e4ce57bea0a401f3f4a13fe504ee320680 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Mon, 7 Aug 2023 00:18:40 +0900 Subject: [PATCH 15/45] =?UTF-8?q?fix:=20useGeolocation=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/hooks/useGeolocation.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/utils/hooks/useGeolocation.ts b/src/utils/hooks/useGeolocation.ts index 771f4d44..ed96e39d 100644 --- a/src/utils/hooks/useGeolocation.ts +++ b/src/utils/hooks/useGeolocation.ts @@ -1,14 +1,17 @@ -import { Coords } from 'api/shop/entity'; import { useEffect, useState } from 'react'; -interface Position { - coords: Coords +interface GeolocationPosition { + latitude: number; + longitude: number; } export default function useGeolocation(options = {}) { - const [location, setLocation] = useState(); - const onGeoSuccess = (geolocation: Position) => { - setLocation(geolocation.coords); + const [location, setLocation] = useState(); + const onGeoSuccess: PositionCallback = (position) => { + setLocation({ + latitude: position.coords.latitude, + longitude: position.coords.longitude, + }); }; const onGeoError = () => {}; From a957c5eb3f1abfc0e8ee24bb743700696ad0419a Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Mon, 7 Aug 2023 00:51:24 +0900 Subject: [PATCH 16/45] =?UTF-8?q?fix:=20filterShopsListResponse=EB=A1=9C?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop/entity.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/api/shop/entity.ts b/src/api/shop/entity.ts index ed53eae5..85be4705 100644 --- a/src/api/shop/entity.ts +++ b/src/api/shop/entity.ts @@ -6,12 +6,18 @@ export interface FilterShopsParams { } export interface FilterShopsResponse { - geometry?: Coords; + geometry: { + location: Coords; + }; name: string; photo: null | string[]; placeId: string; } +export interface FilterShopsListResponse { + content: FilterShopsResponse[]; +} + export interface FetchTrendingsResponse { trendings: string[] } @@ -41,6 +47,6 @@ interface Shop { } export interface Coords { - latitude: number | undefined; - longitude: number | undefined; + lat: number | undefined; + lng: number | undefined; } From 5d93665edee34d4556de4e5b25970c7415caaa29 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Mon, 7 Aug 2023 00:52:17 +0900 Subject: [PATCH 17/45] =?UTF-8?q?fix:=20fetchShops,=20getfilterShops=20api?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop/index.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/api/shop/index.ts b/src/api/shop/index.ts index f2422ffd..d20810e3 100644 --- a/src/api/shop/index.ts +++ b/src/api/shop/index.ts @@ -1,6 +1,6 @@ import { - Coords, - FetchShopsResponse, FetchTrendingsResponse, FilterShopsParams, FilterShopsResponse, ShopsParams, + Coords, FetchShopsResponse, FetchTrendingsResponse, FilterShopsParams, + FilterShopsListResponse, ShopsParams, } from './entity'; import shopApi from './shopApiClient'; @@ -8,9 +8,12 @@ export const fetchTrendings = () => shopApi.get('/trendi export const fetchShop = (shopId: string) => shopApi.get(`/shop?place_id=${shopId}`); -export const fetchShops = (params: ShopsParams) => shopApi.post(`/shops?keyword=${params.keyword}&x=${params.location?.latitude}&y=${params.location?.longitude}`); +export const fetchShops = (params: ShopsParams) => shopApi.post(`/shops?keyword=${params.keyword}`, { + lat: params.location?.lat, + lng: params.location?.lng, +}); -export const getfilterShops = (params: FilterShopsParams, location: Coords) => shopApi.post(`/shops/maps?options_friend=${params.options_friend}&options_nearby=${params.options_nearby}&options_scrap=${params.options_friend}`, { - lat: location.latitude, - lng: location.longitude, +export const getfilterShops = (params: FilterShopsParams, location: Coords) => shopApi.post(`/shops/maps?options_friend=${params.options_friend}&options_nearby=${params.options_nearby}&options_scrap=${params.options_friend}`, { + lat: location.lat, + lng: location.lng, }); From d1bbfc7609c0bd236e48132af5cb1e1549b1f337 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Mon, 7 Aug 2023 00:53:14 +0900 Subject: [PATCH 18/45] =?UTF-8?q?fix:=20params=EC=97=90=EC=84=9C=20locatio?= =?UTF-8?q?n=20=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/SearchDetails/hooks/useFetchShops.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/SearchDetails/hooks/useFetchShops.ts b/src/pages/SearchDetails/hooks/useFetchShops.ts index 9a2558b8..f4c10988 100644 --- a/src/pages/SearchDetails/hooks/useFetchShops.ts +++ b/src/pages/SearchDetails/hooks/useFetchShops.ts @@ -8,7 +8,7 @@ const useFetchShops = (keyword: string) => { maximumAge: 1000, }; const { location } = useGeolocation(options); - const params = { keyword, location }; + const params = { keyword }; const { isLoading, isError, data, refetch, } = useQuery('shop', () => fetchShops(params as ShopsParams), { enabled: !!location }); From 0cb42f93a187ad52772253d555e8eb3949d7d1b1 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Mon, 7 Aug 2023 00:54:24 +0900 Subject: [PATCH 19/45] =?UTF-8?q?fix:=20latitude=20=3D>=20lat,=20longitude?= =?UTF-8?q?=20=3D>=20lng=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/components/Map/hooks/useFilterShops.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Home/components/Map/hooks/useFilterShops.ts b/src/pages/Home/components/Map/hooks/useFilterShops.ts index 585db463..9a4eafd7 100644 --- a/src/pages/Home/components/Map/hooks/useFilterShops.ts +++ b/src/pages/Home/components/Map/hooks/useFilterShops.ts @@ -16,8 +16,8 @@ const useFilterShops = ({ const { isLoading, isError, data, refetch, } = useQuery('filterShops', () => getfilterShops(params, { - latitude: location?.latitude, - longitude: location?.longitude, + lat: location?.latitude, + lng: location?.longitude, }), { enabled: !!(location), }); From 9fd518a1c5c7cf6c5236de99460031b2b46781d9 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Mon, 7 Aug 2023 21:11:40 +0900 Subject: [PATCH 20/45] =?UTF-8?q?fix:=20=EC=9D=B8=EC=9E=90=EC=97=90?= =?UTF-8?q?=EC=84=9C=20index=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Map/components/MarkerHtml/index.tsx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/pages/Home/components/Map/components/MarkerHtml/index.tsx b/src/pages/Home/components/Map/components/MarkerHtml/index.tsx index 6bf8c871..16bdfdd5 100644 --- a/src/pages/Home/components/Map/components/MarkerHtml/index.tsx +++ b/src/pages/Home/components/Map/components/MarkerHtml/index.tsx @@ -1,19 +1,15 @@ -import Default from 'assets/images/search/defaultImg.png'; +import Default from 'assets/images/search/default-image.png'; import MarkerLogo from 'assets/images/home/location-marker.png'; import Selected from 'assets/images/home/selected-marker.png'; import styles from './MarkerHtml.module.scss'; -export function MarkerHtml(thumbnail:string | null, name:string, index:number) { +export function MarkerHtml(photo:string[] | null, name:string) { return `
marker
- -
-
- ${!thumbnail ? index : ''} - + 사진
${name} @@ -23,16 +19,13 @@ export function MarkerHtml(thumbnail:string | null, name:string, index:number) { `; } -export function ClickedMarkerHtml(thumbnail:string | null, name:string, index:number) { +export function ClickedMarkerHtml(photo:string[] | null, name:string) { return `
- -
-
- ${!thumbnail ? index : ''} + 사진
${name} From 812c7a420870d03f411aae6f778fa8108c8ccdaa Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Mon, 7 Aug 2023 21:47:20 +0900 Subject: [PATCH 21/45] =?UTF-8?q?refactor:=20OptionButtons=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OptionButtons/OptionButtons.module.scss | 86 ------------------- .../Map/components/OptionButtons/index.tsx | 49 ----------- 2 files changed, 135 deletions(-) delete mode 100644 src/pages/Home/components/Map/components/OptionButtons/OptionButtons.module.scss delete mode 100644 src/pages/Home/components/Map/components/OptionButtons/index.tsx diff --git a/src/pages/Home/components/Map/components/OptionButtons/OptionButtons.module.scss b/src/pages/Home/components/Map/components/OptionButtons/OptionButtons.module.scss deleted file mode 100644 index f9f19b2f..00000000 --- a/src/pages/Home/components/Map/components/OptionButtons/OptionButtons.module.scss +++ /dev/null @@ -1,86 +0,0 @@ -@keyframes show-out { - from { - opacity: 0; - } - - to { - visibility: visible; - opacity: 1; - } -} - -.button { - z-index: 10; - position: relative; - bottom: 50px; -} - -.filter { - position: absolute; - right: 0; - bottom: -115px; - list-style: none; - - &__button { - display: flex; - justify-content: space-evenly; - align-items: center; - width: 142px; - height: 44px; - background-color: #222222; - border-radius: 22px; - border: none; - margin-top: 15px; - text-decoration: none; - font-size: 18px; - font-weight: 400; - color: #ffffff; - cursor: pointer; - - &--clicked { - background-color: #f6bf54; - } - } - - &__menu-list { - position: absolute; - bottom: 150px; - right: 50px; - display: flex; - flex-direction: column-reverse; - align-items: flex-end; - - &--show { - width: 340px; - - .slide-filter-list { - :nth-child(n) { - animation: show-out 0.2s ease-out normal forwards; - } - } - } - - .slide-filter-list { - visibility: hidden; - justify-content: center; - display: flex; - flex-direction: column; - margin-top: 10px; - - &__button { - width: 142px; - height: 40px; - border-radius: 20px; - box-sizing: border-box; - border: 1px solid #f6bf54; - background-color: #ffffff; - margin-top: 10px; - cursor: pointer; - - &:hover { - text-decoration: underline; - } - } - } - } -} diff --git a/src/pages/Home/components/Map/components/OptionButtons/index.tsx b/src/pages/Home/components/Map/components/OptionButtons/index.tsx deleted file mode 100644 index ca4f6b53..00000000 --- a/src/pages/Home/components/Map/components/OptionButtons/index.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { ReactComponent as MenuIcon } from 'assets/svg/home/menu.svg'; -import { ReactComponent as PencilIcon } from 'assets/svg/home/pencil.svg'; -import { Link } from 'react-router-dom'; -import cn from 'utils/ts/classNames'; -import useBooleanState from 'utils/hooks/useBooleanState'; -import styles from './OptionButtons.module.scss'; - -export default function OptionButtons() { - const [visible, , , toggle] = useBooleanState(false); - return ( -
-
-
- - - - 글쓰기 - -
-
- - - -
-
-
- ); -} From 84067d366173c93fefadaad0772f9d3b3b5d49e5 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Mon, 7 Aug 2023 21:47:54 +0900 Subject: [PATCH 22/45] =?UTF-8?q?feat:=20=EC=A7=80=EB=8F=84=20=EB=B0=8F=20?= =?UTF-8?q?=EB=A7=88=EC=BB=A4=20custom-hook=EC=9C=BC=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/components/Map/hooks/useMarker.ts | 37 +++++++++++++++++++ .../Home/components/Map/hooks/useNaverMap.ts | 3 +- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/pages/Home/components/Map/hooks/useMarker.ts diff --git a/src/pages/Home/components/Map/hooks/useMarker.ts b/src/pages/Home/components/Map/hooks/useMarker.ts new file mode 100644 index 00000000..7116a309 --- /dev/null +++ b/src/pages/Home/components/Map/hooks/useMarker.ts @@ -0,0 +1,37 @@ +/* eslint-disable consistent-return */ +import { useEffect, useState } from 'react'; +import { FilterShopsListResponse } from 'api/shop/entity'; +import { MarkerHtml } from '../components/MarkerHtml'; + +interface MarkerProps { + map: naver.maps.Map | null; + filterShops: FilterShopsListResponse | undefined; +} + +function useMarker({ map, filterShops }: MarkerProps) { + const [markerArray, setMarkerArray] = useState([]); + + useEffect(() => { + if (!map || !filterShops) return; + const newMarkers = (filterShops.content ?? []).map((shop) => { + const lat = shop?.geometry?.location?.lat; + const lng = shop?.geometry?.location?.lng; + + if (!lat || !lng) return; + const marker = new naver.maps.Marker({ + position: new naver.maps.LatLng(lat, lng), + title: shop.name, + map, + icon: { + content: MarkerHtml(shop.photo, shop.name), + }, + }); + return marker; + }).filter((marker) => marker !== undefined) as naver.maps.Marker[]; + setMarkerArray(newMarkers); + }, [map, filterShops]); + + return { markerArray }; +} + +export default useMarker; diff --git a/src/pages/Home/components/Map/hooks/useNaverMap.ts b/src/pages/Home/components/Map/hooks/useNaverMap.ts index 94a92942..1908003b 100644 --- a/src/pages/Home/components/Map/hooks/useNaverMap.ts +++ b/src/pages/Home/components/Map/hooks/useNaverMap.ts @@ -1,3 +1,4 @@ +/* eslint-disable consistent-return */ /* eslint-disable react-hooks/exhaustive-deps */ import { useEffect, useState } from 'react'; @@ -20,8 +21,6 @@ function useNaverMap(latitude: number | undefined, longitude: number | undefined newMaps.destroy(); }; } - - return () => {}; }, [latitude, longitude]); return map; From 5324bf09c8630534ed6451f725b2f502e2fc8c4e Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Mon, 7 Aug 2023 21:49:22 +0900 Subject: [PATCH 23/45] =?UTF-8?q?fix:=20shop/maps=20=EC=9D=91=EB=8B=B5=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=EC=97=90=20=EB=A7=9E=EA=B2=8C=20?= =?UTF-8?q?=EB=8D=94=EB=AF=B8=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EA=B0=92=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/static/marker.ts | 66 ++++++++++----------------------- 1 file changed, 20 insertions(+), 46 deletions(-) diff --git a/src/pages/Home/static/marker.ts b/src/pages/Home/static/marker.ts index 4aa5d29b..809a4266 100644 --- a/src/pages/Home/static/marker.ts +++ b/src/pages/Home/static/marker.ts @@ -1,51 +1,25 @@ const MARKER = [ { - placeName: '박순자 아우내순대', - latitude: 36.761724, - longitude: 127.299092, - index: 1, - }, - { - placeName: '집', - latitude: 36.343087, - longitude: 127.448879, - index: 2, - }, - { - placeName: '3', - latitude: 36.722341, - longitude: 127.269665, - index: 3, - }, - { - placeName: '4', - latitude: 37.762341, - longitude: 125.189675, - index: 4, - }, - { - placeName: '5', - latitude: 36.862341, - longitude: 127.254631, - index: 5, - }, - { - placeName: '6', - latitude: 36.962341, - longitude: 127.218645, - index: 6, - }, - { - placeName: '7', - latitude: 36.562341, - longitude: 127.299565, - index: 7, - }, - { - placeName: '8', - latitude: 36.552341, - longitude: 126.259775, - index: 8, + geometry: { + location: { + lat: 37.5108295, + lng: 127.0292881, + }, + }, + name: '고기', + photo: ['string', 'string'], + placeId: 'string', + }, + { + geometry: { + location: { + lat: 37, + lng: 127, + }, + }, + name: '고기2', + photo: ['string'], + placeId: 'string', }, ]; From 1fff93eb4c7f93625e0bfd8f8a34b9f82653068a Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Wed, 9 Aug 2023 00:00:46 +0900 Subject: [PATCH 24/45] =?UTF-8?q?fix:=20=ED=83=80=EC=9E=85=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop/entity.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/api/shop/entity.ts b/src/api/shop/entity.ts index 85be4705..0f660b96 100644 --- a/src/api/shop/entity.ts +++ b/src/api/shop/entity.ts @@ -14,9 +14,7 @@ export interface FilterShopsResponse { placeId: string; } -export interface FilterShopsListResponse { - content: FilterShopsResponse[]; -} +export type FilterShopsListResponse = FilterShopsResponse[]; export interface FetchTrendingsResponse { trendings: string[] From 92fc0be738421baa6880a0d808d70cee817343ee Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Wed, 9 Aug 2023 00:02:32 +0900 Subject: [PATCH 25/45] =?UTF-8?q?fix:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EB=AA=A9=EC=97=85=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/components/Map/index.tsx | 94 ++++--------------------- 1 file changed, 12 insertions(+), 82 deletions(-) diff --git a/src/pages/Home/components/Map/index.tsx b/src/pages/Home/components/Map/index.tsx index d51e033d..6e9261f0 100644 --- a/src/pages/Home/components/Map/index.tsx +++ b/src/pages/Home/components/Map/index.tsx @@ -1,99 +1,29 @@ -import { useEffect, useRef } from 'react'; import useGeolocation from 'utils/hooks/useGeolocation'; -import MARKER from 'pages/Home/static/marker'; import useMediaQuery from 'utils/hooks/useMediaQuery'; import styles from './Map.module.scss'; -import OptionButtons from './components/OptionButtons'; import MobileOptions from './components/MobileOptions'; -import { ClickedMarkerHtml, MarkerHtml } from './components/MarkerHtml'; +import useNaverMap from './hooks/useNaverMap'; +import useMarker from './hooks/useMarker'; +import useFilterShops from './hooks/useFilterShops'; -interface MarkerType { - latitude: number; - longitude: number; - placeName: string; - index: number; -} -const options = { +const OPTIONS = { maximumAge: 1000, }; export default function Map(): JSX.Element { const { isMobile } = useMediaQuery(); - const { location } = useGeolocation(options); - const mapRef = useRef(null); - const selectedMarker = useRef(null); - - const markerHighlightEvent = (markerCur:naver.maps.Marker, item:MarkerType) => { - naver.maps.Event.addListener(markerCur, 'click', () => { - if (selectedMarker.current) { - selectedMarker.current.setIcon({ - content: MarkerHtml( - '', - selectedMarker.current.getTitle(), - selectedMarker.current.getZIndex(), - ), - size: new naver.maps.Size(50, 52), - anchor: new naver.maps.Point(25, 26), - }); - } - - markerCur.setIcon({ - // 추후 각 마커벼로 이미지파일이 주어지면 첫번째 인자로 해당 이미지를 넘겨주도록 해야함 - content: ClickedMarkerHtml('', item.placeName, item.index), - size: new naver.maps.Size(50, 52), - anchor: new naver.maps.Point(25, 26), - }); - - selectedMarker.current = markerCur; - - if (mapRef.current) { - const mapLatLng = new naver.maps.LatLng(item.latitude, item.longitude); - mapRef.current.panTo(mapLatLng); - } - }); - }; - - useEffect(() => { - if (!mapRef.current && typeof location !== 'undefined') { - mapRef.current = new naver.maps.Map('map', { - center: new naver.maps.LatLng(location.latitude, location.longitude), - zoomControl: false, - zoom: 10, - scaleControl: false, - logoControl: false, - mapDataControl: false, - }); - } - - return () => { - if (mapRef.current) { - mapRef.current.destroy(); - } - }; - }, [location]); + const { location } = useGeolocation(OPTIONS); + const map = useNaverMap(location?.latitude, location?.longitude); + const { data: filterShops } = useFilterShops({ + options_friend: 1, + options_scrap: 1, + options_nearby: 1, + }); + useMarker({ map, filterShops }); - useEffect(() => { - MARKER.forEach((item:MarkerType) => { - if (mapRef.current) { - const markers = new naver.maps.Marker({ - position: new naver.maps.LatLng(item.latitude, item.longitude), - title: item.placeName, - map: mapRef.current, - zIndex: item.index, - icon: { - content: MarkerHtml('', item.placeName, item.index), - size: new naver.maps.Size(50, 52), - anchor: new naver.maps.Point(25, 26), - }, - }); - markerHighlightEvent(markers, item); - } - }); - }, [location]); return (
{isMobile && }
- {!isMobile && }
); } From cc3087750086a6839c2448d4c11335991944319c Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sat, 12 Aug 2023 23:56:02 +0900 Subject: [PATCH 26/45] =?UTF-8?q?fix:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/components/Map/components/MarkerHtml/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Home/components/Map/components/MarkerHtml/index.tsx b/src/pages/Home/components/Map/components/MarkerHtml/index.tsx index 16bdfdd5..8296f869 100644 --- a/src/pages/Home/components/Map/components/MarkerHtml/index.tsx +++ b/src/pages/Home/components/Map/components/MarkerHtml/index.tsx @@ -3,7 +3,7 @@ import MarkerLogo from 'assets/images/home/location-marker.png'; import Selected from 'assets/images/home/selected-marker.png'; import styles from './MarkerHtml.module.scss'; -export function MarkerHtml(photo:string[] | null, name:string) { +export function MarkerHtml(photo:string | null, name:string) { return `
marker @@ -19,7 +19,7 @@ export function MarkerHtml(photo:string[] | null, name:string) { `; } -export function ClickedMarkerHtml(photo:string[] | null, name:string) { +export function ClickedMarkerHtml(photo:string | null, name:string) { return `
From 20cc9013c636e9b5ddc7239c917033ae8b880fa8 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sat, 12 Aug 2023 23:57:09 +0900 Subject: [PATCH 27/45] =?UTF-8?q?fix:=20=EC=A7=80=EB=8F=84=20=EC=A4=8C=20?= =?UTF-8?q?=EB=A0=88=EB=B2=A8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/components/Map/hooks/useNaverMap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Home/components/Map/hooks/useNaverMap.ts b/src/pages/Home/components/Map/hooks/useNaverMap.ts index 1908003b..383dc91b 100644 --- a/src/pages/Home/components/Map/hooks/useNaverMap.ts +++ b/src/pages/Home/components/Map/hooks/useNaverMap.ts @@ -10,7 +10,7 @@ function useNaverMap(latitude: number | undefined, longitude: number | undefined const newMaps = new naver.maps.Map('map', { center: new naver.maps.LatLng(latitude, longitude), zoomControl: false, - zoom: 10, + zoom: 15, scaleControl: false, logoControl: false, mapDataControl: false, From 1d51dfe997c313c6885429d54187bc561afaaf25 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sat, 12 Aug 2023 23:57:38 +0900 Subject: [PATCH 28/45] =?UTF-8?q?style:=20=EC=A2=8C=ED=91=9C=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EA=B2=8C=20=EC=9C=84=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Map/components/MarkerHtml/MarkerHtml.module.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/Home/components/Map/components/MarkerHtml/MarkerHtml.module.scss b/src/pages/Home/components/Map/components/MarkerHtml/MarkerHtml.module.scss index 8810ca79..475333c5 100644 --- a/src/pages/Home/components/Map/components/MarkerHtml/MarkerHtml.module.scss +++ b/src/pages/Home/components/Map/components/MarkerHtml/MarkerHtml.module.scss @@ -1,10 +1,13 @@ @use "src/utils/styles/mediaQuery" as media; .container { + position: absolute; display: flex; justify-content: center; flex-direction: column; align-items: center; + top: -65px; + left: -50px; } .marker { From bad40cd99abcdd33332d62bc80571613b6e30f59 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 13 Aug 2023 02:30:19 +0900 Subject: [PATCH 29/45] =?UTF-8?q?fix:=20png=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/images/home/selected-marker.png | Bin 1778 -> 3692 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/assets/images/home/selected-marker.png b/src/assets/images/home/selected-marker.png index 2f0a2d5ddcd586541deefd4a6d514b65acbea96a..47b06b6453341291436acc4f9e0495e97e769ef4 100644 GIT binary patch literal 3692 zcmXX}dpy(o|KHYRnaf;qtr@u%xrf#=*GMk8=I%rYp@b1JmvSnX6Gb5;C5YCr9YUTGPz0NiAOs(&lsZ7N+-`O_KQx|d0Lk!jfAh< z-=Ajm&@P5?ctGja^8!|0{zh`>uc5)`MS99mgjPfM7xlAWQ%l}-7&hED*-=jlbJe|> z?%lP1f71?GNAdfdW$bt9W%T*PbzWOSv3)sXk$9b--En0xy2 zG8FLji^@SJ91`9PKU4oFuyDOW+M< zhryKdyk)nE+!jU3piYjvUXr18^$op=foSikvUpxgnlh>C;EajCCOsn5rra1J3U zgOu?Rc=$8?H->hNKNQiVTE)!#loD4YXDwluWg71%OEM>Opw&@dNmWu%1m71cfl(_k zc38a}N!lMmo5_xe98*XhUvbosC?p}UApA`coj^kZHKECzWO#XSri z#dgHMyF?$EIyZ5L8Zvn(A+<59WY{EOzm_lThNS zMd)ic{aljUx8%ntr?pWkwl}H z*dO0G{f7XK7rqAV@*2l`pL(~_2v^aWC~CkB+2(|SF|4tKs(s3t<+K?JNfRSOf27}T z2?9f{bWuc8y8ny=*YK1+uHsncpM1^u-7khDu>iAIh%CV^&u)q<@V3yR0Z{`LPX|9! zz8!VDheDefcMZu^Nsn%~0Yo*RgI#Um)xrn9@#ZdA=Us;Z!dlK)3%68iJS(aFj96ew z=PREUIS34;uRUBASr(h(vy9}`a&-ABK*+GC2>F?%-*3ELl(Q4U4Easj@NBM$G4Y_I7&2c?m~c zIXY{ZAoDK(3xzTr4ShN_BaLvU{aKOtE()s25s-uJtG2TGFGaZ1(1n+@jjS2&q5u_f z6o0nDPZMXv9MUYl7u&m?v2G=>j~1qg>Qe((o|$7k^XEA^6<-q=(btY^2;cDFi~l{_ zyT_;$Xm~L62txi>0x6NuM_+9eezA?=t(1I_@FOdvbl}U?gC)WO@0Qqt1(x#K>6{z9 zL%wzS`?pnFvFl+C;;gm^K`gLSQcu%ro2|s?o$R%3!Y4`l$s3+^|5f{<+fKp(D;XJz z&(y8OYLaSP|6ij}DO!rM4@y*ztrzqL_uF0Zz!ZwVh(Oi}FLDd{<=b7S^V3!!d>q_9 z-1N`PM9+ZLjG$F`&`?XmOeQ+;xE-KK5wTQ>CK+XO9D!@+$oQ>*a=RTVhRi- z$dVs~@#LU~4YKa<30vjRr!?8afE*SlR6o707SAgf;54KW&=jfGJpwdpu5Dx&rm-xA z5t2S7z=~p5V+rqma`S~^CyX>PglqS==cE-&nCt0h=jjwZVxH2u3f}=J^PREC@&T8_v>8aBb6fN@PT7MMvp?F z2v~ClGVGMXR)jPE%{XaGe;n}zp7n5FMn)2(x!33eyz&_`wr8P&#W=BT*IwvLf7-&% z*ic)F-xZ}R*2k?|1mG4R>u1}hk8K@FFYw+{yO;VQb)YyG2qoJCMNM;lXcy)l`ny2K z)4~TW<)(T!58#wa51TR)EBy>QyUlt2MP<=RjJr-(2N)+D1n>bjx<1Dcr02g#Q|2+G zoW;Y{qk?(BrgW0_^fX7;0;B$2!;dgWsGio|2_ynmnQ=s4r2sbh292u_lWrj9xLlJJ z)N&_KOXfb8wv9OIO_GGk>yPheW=|8C-Mgw_0xj(QwvcMOp*sxyG|pRoo^JxbEG=>| z&^Yx%D{zJpT2?6E1&KTTd`8Z4c}L%qq?>d9THaxHKF_Tm6%x3u>E7~~e@*rm3j+39 z1!pY17d?8xU_KsLVp!;1-*nX8k1p{(I%XsK&GFw-T&!x_4d^N*8WzVuc)o~DRAWD) z$9o?9dV<5S7GJmX3xQjUujP`&fXtml?Xwnj`8vj@WHPmX^|vRgU&nC$^v48UUM(3B zIl&p1rY{sRU3<8NJ^Z}Vw-=ti*138lVN?{j8$nf<2`k5 z*Fg}f+_35Uc4Vs8J@&@yk!D4BU>a5wU3yrz7?>z3VwlJqU0(>F7`LZ?6tAH@`q{)X_Z}+HsGg{gpK7@@{ctD60*iY) z^+Kq~O3XE223H{DlCp?%1xGe-wwd%{Bm!SBHxev&0RjJqomel5>{KdSW zQ#0>ut($=-TzLl4Yq)EC_uTI*#v18j!>F zA0lj5gqA57rG+3sVI)IyD$VSH;nmQ&q$l5CzOnc zD0Jk#a-sXhZ7Pj;t*PQP`%(+uz>Rr}OyS+}f1g^Eq+eEHpJVeSn>4Ge8EXe`5h-pb zhOl)61&?=EHy_{b_uf1xVJ13?M)9KNo%n~RE~TqYpD=+(t~QQdG$XA&a^SfrnE?Bv zQ0Rsp{O8V|WPI5CgyxR5<havzSQgv?p~6|+IeOJI z%Zj1tP%BL~oh^1^Rf=5wC#RYQD@E|n@z;;0?h24*DxX0ij)Q}QiLpH;!(w0c;CXi4 z#TmRTX3~`7kGte$En)ny2vil9CQZ$biAX;gVFu9S z1TW4yJ2mz|(QjD^UE?&Lui>R&)azggoO$z?+?M=}53f$DW?;=>f0ZR$ X-X+H*O9lX6kst?KXPZW=;LQI44n3FX literal 1778 zcmVG~mL9LjozKfri3&lljl=?B4p$_I>Q0ca#55TJ7w8IE8R+CSts*uNlE%STrnBOPPZRyFMqI+$%(g`JJlw^!K5E?Rv*Im?hOfB<7 z66;T&zbHyI?FHo}lhFQdr_8IOy5}d!na7gY+_Y6iS8j-pz7V(mKIJ8ola_hQMCJ42 zM&*$ucIiX+ds`C2joIldF83v5TDJZ&B7bRw{?=V<-Bg!;Umo@ABT1~6kG^aELaqtQ zWf1qwSB$6Nem_0+Sho23X@()D%-DkXEkl_3>RL z79HHTH*siMP+&4^yvQiwnvpH*?!r)s^)kMoqAJAaLdbytkUX6)B1JCr2A` z8o@l66bYoYHa}KNJJX7EBo4H*y#9d@QYerWV2%!`=u|Y0B~C?QOra#CXxK?+wpvl| zkH$$P4zvrujKZX-V5-BAXly066$uoT8HGvFK{R&M?W1twBXKWSvghi85K?Fmjs5IN zJj*FwVkNKHGovsm1GTr^**%ObDsFDT@Q;2GLJAKabNcLMH&)$e0@<$A?8T86g^*Iv zpHgfess*Mh;Uwl$8l+74psRXDVx{KYizkGT(%^j!)O-*xDdmdDgp`9g{na&8C)_eq z{j2g2Qgq^=tLB1uK|jt|BV{7-wHgQ^C5IA|(nE6_5!PV6H*qiaJNOb1L>-c9WxS>GU0vg z1z{kEx?%hx^I}p4{1yt}&~`hB7NQ8ZX4=mRL16LW!esO9&|(xMy>nx=^iHUoGhgKt39WUobZ&#RBreOQ5=o{coit zPDNwvEk;ODSpCqCT01vv9Gr^jEk{ZbxAq7*KoEhQi&$iPV1K&-iJj%@yuE<^$!sA) zW)C{aaT*~*x6K_oDPApapl%#mfp5RZ{FodJ*1vOZtktq=Zmtgd*zQkusP3C~!aQ2h zcP|SeGX(;--tn2hs=Bn%-0h>gN^Bb-s&^7U&Tb-|B-VuFOG;pD#+a@~>}1bp>}>v_ z0*Xv#2Xf$)z*BCE>q%{oi{)QWUlBqw2QB5KM-d{W&18de4@D-q0cr8Syl*LMxvnm4 zE{*#2ktMc2nx3$o92SZr=7{Vu=Ao zCNX|R9+b#1#`)p;u;(^I>6#n2mB}OTPNtF=%tU1T^`iaA2}xxHQMPSNxnpX+t!bm~ zFs7CmNQ{&d?B2!>8Cb>uqCK8zflL^Re zy8}0k6Z4UyiS@0sdq3*r=a5ohGA6l2Voxd}W3Rl0hDdcG*-Q`8qLYJ(Ag-H3fyr3p zE-`Q-SFW1j>3u#r@*Gk^JTsBlqnpR-($fu5dfxogwdmE3Xt^Unuo|s Date: Sun, 13 Aug 2023 02:30:40 +0900 Subject: [PATCH 30/45] =?UTF-8?q?style:=20=ED=81=B4=EB=A6=AD=EB=90=9C=20?= =?UTF-8?q?=EB=A7=88=EC=BB=A4=20=EB=94=94=EC=9E=90=EC=9D=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MarkerHtml/MarkerHtml.module.scss | 49 +++---------------- 1 file changed, 7 insertions(+), 42 deletions(-) diff --git a/src/pages/Home/components/Map/components/MarkerHtml/MarkerHtml.module.scss b/src/pages/Home/components/Map/components/MarkerHtml/MarkerHtml.module.scss index 475333c5..96759f95 100644 --- a/src/pages/Home/components/Map/components/MarkerHtml/MarkerHtml.module.scss +++ b/src/pages/Home/components/Map/components/MarkerHtml/MarkerHtml.module.scss @@ -21,13 +21,10 @@ &--clicked { position: absolute; - left: 20px; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; width: 175px; height: 69px; + top: -70px; + left: -30px; @include media.media-breakpoint-down(mobile) { width: 125px; @@ -64,8 +61,8 @@ height: 55.723px; border-radius: 89.5px; position: absolute; - top: 2px; - left: 22px; + top: -67px; + left: -26px; @include media.media-breakpoint-down(mobile) { width: 36px; @@ -94,12 +91,12 @@ width: 100px; height: 40px; position: absolute; + bottom: 20px; + left: 30px; text-align: center; - top: 10px; - left: 75px; font-size: 20px; font-weight: 700; - color: #fe7f23; + color: #ffffff; @include media.media-breakpoint-down(mobile) { width: 70px; @@ -110,36 +107,4 @@ } } } - - &__index { - color: #ffffff; - position: absolute; - top: 18px; - left: 43px; - font-size: 24px; - font-weight: 700; - z-index: 999; - - @include media.media-breakpoint-down(mobile) { - font-size: 16px; - top: 13px; - left: 46px; - } - - &--clidked { - color: #ffffff; - position: absolute; - left: 43px; - font-size: 24px; - font-weight: 700; - z-index: 999; - top: 15px; - - @include media.media-breakpoint-down(mobile) { - font-size: 16px; - top: 10px; - left: 35px; - } - } - } } From ca6f2eec18da203fa7551ab46378b2695b0a5d5a Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 13 Aug 2023 02:31:00 +0900 Subject: [PATCH 31/45] =?UTF-8?q?fix:=20=EB=AA=A9=EC=97=85=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/static/marker.ts | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/pages/Home/static/marker.ts b/src/pages/Home/static/marker.ts index 809a4266..facc396d 100644 --- a/src/pages/Home/static/marker.ts +++ b/src/pages/Home/static/marker.ts @@ -2,24 +2,35 @@ const MARKER = [ { geometry: { location: { - lat: 37.5108295, - lng: 127.0292881, + lat: 37.5085007, + lng: 127.0243059, }, }, - name: '고기', - photo: ['string', 'string'], - placeId: 'string', + name: '삼촌네고깃집2', + photo: 'null', + placeId: 'nmap-119FC9E2-1E6F-4920-8734-0D82644CFFBF', }, { geometry: { location: { - lat: 37, - lng: 127, + lat: 37.5018927, + lng: 127.0360738, }, }, - name: '고기2', - photo: ['string'], - placeId: 'string', + name: '멕시카나 치킨2', + photo: 'null', + placeId: 'nmarker-3DC43A25-00E4-485E-B823-C87666B8B4A0', + }, + { + geometry: { + location: { + lat: 37.5030426, + lng: 127.041588, + }, + }, + name: '아라미즈2', + photo: 'null', + placeId: 'nmarker-B8FB8547-EFB9-416B-BA20-02749D239706', }, ]; From ecad2ac0bed8076a442f469403bd2ffeacae8d69 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 13 Aug 2023 02:31:24 +0900 Subject: [PATCH 32/45] =?UTF-8?q?feat:=20=EB=A7=88=EC=BB=A4=20custom-hook?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/components/Map/hooks/useMarker.ts | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/pages/Home/components/Map/hooks/useMarker.ts b/src/pages/Home/components/Map/hooks/useMarker.ts index 7116a309..e2201da6 100644 --- a/src/pages/Home/components/Map/hooks/useMarker.ts +++ b/src/pages/Home/components/Map/hooks/useMarker.ts @@ -1,7 +1,8 @@ /* eslint-disable consistent-return */ import { useEffect, useState } from 'react'; import { FilterShopsListResponse } from 'api/shop/entity'; -import { MarkerHtml } from '../components/MarkerHtml'; +import MARKER from 'pages/Home/static/marker'; +import { ClickedMarkerHtml, MarkerHtml } from '../components/MarkerHtml'; interface MarkerProps { map: naver.maps.Map | null; @@ -9,29 +10,49 @@ interface MarkerProps { } function useMarker({ map, filterShops }: MarkerProps) { - const [markerArray, setMarkerArray] = useState([]); + const [, setMarkerArray] = useState<(naver.maps.Marker | undefined)[]>([]); + const [selected, setSelected] = useState(); useEffect(() => { if (!map || !filterShops) return; - const newMarkers = (filterShops.content ?? []).map((shop) => { + // 사용량 제한으로, 현재는 목업 데이터로 마커를 찍고 있음 + // const newMarkers = (fitlerShops?? []).map((shop) => { + const newMarkers = (MARKER ?? []).map((shop) => { const lat = shop?.geometry?.location?.lat; const lng = shop?.geometry?.location?.lng; - if (!lat || !lng) return; + const marker = new naver.maps.Marker({ position: new naver.maps.LatLng(lat, lng), title: shop.name, map, icon: { - content: MarkerHtml(shop.photo, shop.name), + content: MarkerHtml(shop.name, shop.name), }, }); + + naver.maps.Event.addListener(marker, 'click', () => { + newMarkers.forEach((m) => { + m?.setIcon({ + content: MarkerHtml(m.getTitle(), m.getTitle()), + }); + }); + + marker.setIcon({ + content: ClickedMarkerHtml(shop.name, shop.name), + }); + setSelected(marker); + if (map) { + map.panTo(marker.getPosition()); + } + }); return marker; - }).filter((marker) => marker !== undefined) as naver.maps.Marker[]; + }); + setMarkerArray(newMarkers); }, [map, filterShops]); - return { markerArray }; + return { selected }; } export default useMarker; From 8e1ef4d2f74647bdbf5359f63947764fe173f5b2 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 13 Aug 2023 02:55:28 +0900 Subject: [PATCH 33/45] =?UTF-8?q?fix:=20zIndex=EB=A5=BC=20=ED=99=9C?= =?UTF-8?q?=EC=9A=A9=ED=95=B4=20=EB=A7=88=EC=BB=A4=20=EC=9A=B0=EC=84=A0?= =?UTF-8?q?=EC=88=9C=EC=9C=84=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/components/Map/hooks/useMarker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/Home/components/Map/hooks/useMarker.ts b/src/pages/Home/components/Map/hooks/useMarker.ts index e2201da6..5d20508f 100644 --- a/src/pages/Home/components/Map/hooks/useMarker.ts +++ b/src/pages/Home/components/Map/hooks/useMarker.ts @@ -17,7 +17,7 @@ function useMarker({ map, filterShops }: MarkerProps) { if (!map || !filterShops) return; // 사용량 제한으로, 현재는 목업 데이터로 마커를 찍고 있음 // const newMarkers = (fitlerShops?? []).map((shop) => { - const newMarkers = (MARKER ?? []).map((shop) => { + const newMarkers = (MARKER ?? []).map((shop, index) => { const lat = shop?.geometry?.location?.lat; const lng = shop?.geometry?.location?.lng; if (!lat || !lng) return; @@ -26,6 +26,7 @@ function useMarker({ map, filterShops }: MarkerProps) { position: new naver.maps.LatLng(lat, lng), title: shop.name, map, + zIndex: MARKER.length - index, icon: { content: MarkerHtml(shop.name, shop.name), }, From f127d7a9379bd20fe2090d1a745a18c260a75c67 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 13 Aug 2023 02:57:14 +0900 Subject: [PATCH 34/45] =?UTF-8?q?feat:=20=EB=A7=88=EC=BB=A4=EC=97=90=20?= =?UTF-8?q?=ED=95=80=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/components/Map/index.tsx | 5 +++-- src/pages/Home/components/Pin/index.tsx | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 src/pages/Home/components/Pin/index.tsx diff --git a/src/pages/Home/components/Map/index.tsx b/src/pages/Home/components/Map/index.tsx index 6e9261f0..4edbf86f 100644 --- a/src/pages/Home/components/Map/index.tsx +++ b/src/pages/Home/components/Map/index.tsx @@ -5,6 +5,7 @@ import MobileOptions from './components/MobileOptions'; import useNaverMap from './hooks/useNaverMap'; import useMarker from './hooks/useMarker'; import useFilterShops from './hooks/useFilterShops'; +import Pin from '../Pin'; const OPTIONS = { maximumAge: 1000, @@ -18,11 +19,11 @@ export default function Map(): JSX.Element { options_scrap: 1, options_nearby: 1, }); - useMarker({ map, filterShops }); - + const { selected } = useMarker({ map, filterShops }); return (
{isMobile && } + {selected && }
); diff --git a/src/pages/Home/components/Pin/index.tsx b/src/pages/Home/components/Pin/index.tsx new file mode 100644 index 00000000..32fd1502 --- /dev/null +++ b/src/pages/Home/components/Pin/index.tsx @@ -0,0 +1,11 @@ +interface PinProps { + selected : naver.maps.Marker; +} + +export default function Pin({ selected } : PinProps): JSX.Element { + return ( +
+ {selected.getTitle()} +
+ ); +} From d197c9a01f6fa8f7ee59ff7a9d783521507daa1a Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 13 Aug 2023 22:13:08 +0900 Subject: [PATCH 35/45] =?UTF-8?q?fix:=20api=20url=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/shop/index.ts b/src/api/shop/index.ts index d20810e3..d25fe010 100644 --- a/src/api/shop/index.ts +++ b/src/api/shop/index.ts @@ -13,7 +13,7 @@ export const fetchShops = (params: ShopsParams) => shopApi.post shopApi.post(`/shops/maps?options_friend=${params.options_friend}&options_nearby=${params.options_nearby}&options_scrap=${params.options_friend}`, { +export const getfilterShops = (params: FilterShopsParams, location: Coords) => shopApi.post(`/shops/maps?options_friend=${params.options_friend}&options_nearby=${params.options_nearby}&options_scrap=${params.options_scrap}`, { lat: location.lat, lng: location.lng, }); From a3a84a33103505f0fe160afa5c8ef10c62bd9908 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 13 Aug 2023 22:15:59 +0900 Subject: [PATCH 36/45] =?UTF-8?q?fix:=20=EB=B2=84=ED=8A=BC=20=EC=A0=84?= =?UTF-8?q?=EC=97=AD=20=EC=83=81=ED=83=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/SideNavigation/index.tsx | 31 ++++++++++++++-- .../Home/components/Map/hooks/useMarker.ts | 14 +++++--- src/pages/Home/components/Map/index.tsx | 19 +++++++--- src/store/filter.ts | 35 +++++++++++++++++++ 4 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 src/store/filter.ts diff --git a/src/components/common/SideNavigation/index.tsx b/src/components/common/SideNavigation/index.tsx index db537f42..50d47665 100644 --- a/src/components/common/SideNavigation/index.tsx +++ b/src/components/common/SideNavigation/index.tsx @@ -13,11 +13,15 @@ import { useAuth } from 'store/auth'; import cn from 'utils/ts/classNames'; import useBooleanState from 'utils/hooks/useBooleanState'; import { Link } from 'react-router-dom'; +import { useFilterFriend, useFilterNearby, useFilterScrap } from 'store/filter'; import styles from './SideNavigation.module.scss'; export default function TopNavigation(): JSX.Element { const auth = useAuth(); const [visible, , , toggle] = useBooleanState(false); + const { filterFriendState, setFilterFriend } = useFilterFriend(); + const { filterScrapState, setFilterScrap } = useFilterScrap(); + const { filterNearbyState, setFilterNearby } = useFilterNearby(); const TABS = [ { @@ -118,15 +122,36 @@ export default function TopNavigation(): JSX.Element {
- - - diff --git a/src/pages/Home/components/Map/hooks/useMarker.ts b/src/pages/Home/components/Map/hooks/useMarker.ts index 5d20508f..0cac021f 100644 --- a/src/pages/Home/components/Map/hooks/useMarker.ts +++ b/src/pages/Home/components/Map/hooks/useMarker.ts @@ -1,3 +1,4 @@ +/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable consistent-return */ import { useEffect, useState } from 'react'; import { FilterShopsListResponse } from 'api/shop/entity'; @@ -10,14 +11,14 @@ interface MarkerProps { } function useMarker({ map, filterShops }: MarkerProps) { - const [, setMarkerArray] = useState<(naver.maps.Marker | undefined)[]>([]); + const [,setMarkerArray] = useState<(naver.maps.Marker | undefined)[]>([]); const [selected, setSelected] = useState(); useEffect(() => { if (!map || !filterShops) return; // 사용량 제한으로, 현재는 목업 데이터로 마커를 찍고 있음 - // const newMarkers = (fitlerShops?? []).map((shop) => { - const newMarkers = (MARKER ?? []).map((shop, index) => { + const newMarkers = (filterShops ?? []).map((shop, index) => { + // const newMarkers = (MARKER ?? []).map((shop, index) => { const lat = shop?.geometry?.location?.lat; const lng = shop?.geometry?.location?.lng; if (!lat || !lng) return; @@ -49,8 +50,13 @@ function useMarker({ map, filterShops }: MarkerProps) { }); return marker; }); - setMarkerArray(newMarkers); + + return () => { + newMarkers.forEach((marker) => { + marker?.setMap(null); + }); + }; }, [map, filterShops]); return { selected }; diff --git a/src/pages/Home/components/Map/index.tsx b/src/pages/Home/components/Map/index.tsx index 4edbf86f..1757e1d3 100644 --- a/src/pages/Home/components/Map/index.tsx +++ b/src/pages/Home/components/Map/index.tsx @@ -1,5 +1,7 @@ import useGeolocation from 'utils/hooks/useGeolocation'; import useMediaQuery from 'utils/hooks/useMediaQuery'; +import { useEffect } from 'react'; +import { useFilterFriend, useFilterNearby, useFilterScrap } from 'store/filter'; import styles from './Map.module.scss'; import MobileOptions from './components/MobileOptions'; import useNaverMap from './hooks/useNaverMap'; @@ -14,12 +16,21 @@ export default function Map(): JSX.Element { const { isMobile } = useMediaQuery(); const { location } = useGeolocation(OPTIONS); const map = useNaverMap(location?.latitude, location?.longitude); - const { data: filterShops } = useFilterShops({ - options_friend: 1, - options_scrap: 1, - options_nearby: 1, + const { filterFriendState } = useFilterFriend(); + const { filterScrapState } = useFilterScrap(); + const { filterNearbyState } = useFilterNearby(); + const { data: filterShops, refetch } = useFilterShops({ + options_friend: filterFriendState, + options_scrap: filterScrapState, + options_nearby: filterNearbyState, }); + const { selected } = useMarker({ map, filterShops }); + + useEffect(() => { + refetch(); + }, [filterFriendState, filterScrapState, filterNearbyState, refetch]); + return (
{isMobile && } diff --git a/src/store/filter.ts b/src/store/filter.ts new file mode 100644 index 00000000..cf9e3422 --- /dev/null +++ b/src/store/filter.ts @@ -0,0 +1,35 @@ +import { atom, useAtomValue, useSetAtom } from 'jotai'; + +export const filterFriendAtom = atom<0 | 1>(0); +export const filterScrapAtom = atom<0 | 1>(0); +export const filterNearbyAtom = atom<0 | 1>(0); + +export const useFilterFriend = () => { + const filterFriendState = useAtomValue(filterFriendAtom); + const setFilterFriend = useSetAtom(filterFriendAtom); + + return { + filterFriendState, + setFilterFriend, + }; +}; + +export const useFilterScrap = () => { + const filterScrapState = useAtomValue(filterScrapAtom); + const setFilterScrap = useSetAtom(filterScrapAtom); + + return { + filterScrapState, + setFilterScrap, + }; +}; + +export const useFilterNearby = () => { + const filterNearbyState = useAtomValue(filterNearbyAtom); + const setFilterNearby = useSetAtom(filterNearbyAtom); + + return { + filterNearbyState, + setFilterNearby, + }; +}; From 2ce7c016777bd400732cb129f459ac7285ada424 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 13 Aug 2023 22:21:39 +0900 Subject: [PATCH 37/45] =?UTF-8?q?fix:=20MenuIcon=20=EC=A0=9C=EA=B1=B0=20?= =?UTF-8?q?=EB=B0=8F=20=EB=94=94=EC=9E=90=EC=9D=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/SideNavigation/SideNavigation.module.scss | 12 +++++++++++- src/components/common/SideNavigation/index.tsx | 2 -- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/common/SideNavigation/SideNavigation.module.scss b/src/components/common/SideNavigation/SideNavigation.module.scss index 16672201..97bea711 100644 --- a/src/components/common/SideNavigation/SideNavigation.module.scss +++ b/src/components/common/SideNavigation/SideNavigation.module.scss @@ -171,6 +171,7 @@ &__search-buttons { display: flex; + margin-right: 15px; gap: 8px; margin-top: 16px; } @@ -179,7 +180,7 @@ border: none; background-color: #ffffff; font-size: 15px; - width: 145px; + width: 135px; height: 35px; font-weight: 500; color: #666666; @@ -190,5 +191,14 @@ svg { padding-left: 5px; } + + &--clicked { + color: #ff7f23; + box-shadow: 2px 2px 3px 0 rgba(0 0 0 / 20%); + + path { + fill: #ff7f23; + } + } } } diff --git a/src/components/common/SideNavigation/index.tsx b/src/components/common/SideNavigation/index.tsx index 50d47665..450486da 100644 --- a/src/components/common/SideNavigation/index.tsx +++ b/src/components/common/SideNavigation/index.tsx @@ -3,7 +3,6 @@ import { ReactComponent as SettingIcon } from 'assets/svg/common/setting.svg'; import { ReactComponent as WriteIcon } from 'assets/svg/common/write.svg'; import { ReactComponent as MyPageIcon } from 'assets/svg/common/my-page.svg'; import { ReactComponent as SearchIcon } from 'assets/svg/search/lens.svg'; -import { ReactComponent as MenuIcon } from 'assets/svg/common/menu.svg'; import { ReactComponent as StoreFrontIcon } from 'assets/svg/home/storefront.svg'; import { ReactComponent as BookMarkIcon } from 'assets/svg/home/bookmark.svg'; import { ReactComponent as GroupIcon } from 'assets/svg/home/group.svg'; @@ -115,7 +114,6 @@ export default function TopNavigation(): JSX.Element { >
- From cf0577e24dc8541a73e1d9cc7cbbd3648d596a3e Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sun, 13 Aug 2023 22:30:59 +0900 Subject: [PATCH 38/45] =?UTF-8?q?fix:=20enabled=20=EC=98=B5=EC=85=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Home/components/Map/hooks/useFilterShops.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/Home/components/Map/hooks/useFilterShops.ts b/src/pages/Home/components/Map/hooks/useFilterShops.ts index 9a4eafd7..8e8f46d7 100644 --- a/src/pages/Home/components/Map/hooks/useFilterShops.ts +++ b/src/pages/Home/components/Map/hooks/useFilterShops.ts @@ -2,6 +2,7 @@ import useGeolocation from 'utils/hooks/useGeolocation'; import { useQuery } from 'react-query'; import { getfilterShops } from 'api/shop'; import { FilterShopsParams } from 'api/shop/entity'; +import { useAuth } from 'store/auth'; const OPTIONS = { maximumAge: 1000, @@ -10,6 +11,8 @@ const useFilterShops = ({ options_friend, options_nearby, options_scrap, }: FilterShopsParams) => { const { location } = useGeolocation(OPTIONS); + const auth = useAuth(); + const enabled = !!(location) && !!auth; const params: FilterShopsParams = { options_friend, options_nearby, options_scrap, }; @@ -19,7 +22,7 @@ const useFilterShops = ({ lat: location?.latitude, lng: location?.longitude, }), { - enabled: !!(location), + enabled, }); const isFetching = isLoading || !(location); From d57a01f295ff8be94f5e212a3fd01ef3c30ad9b6 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Tue, 22 Aug 2023 00:19:36 +0900 Subject: [PATCH 39/45] =?UTF-8?q?fix:=20=EA=B2=BD=EB=A1=9C=EC=97=90=20?= =?UTF-8?q?=EB=94=B0=EB=9D=BC=20=ED=86=A0=EA=B8=80=20=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/SideNavigation/index.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/common/SideNavigation/index.tsx b/src/components/common/SideNavigation/index.tsx index 450486da..257610c6 100644 --- a/src/components/common/SideNavigation/index.tsx +++ b/src/components/common/SideNavigation/index.tsx @@ -11,17 +11,24 @@ import { ReactComponent as FoldIcon } from 'assets/svg/common/fold.svg'; import { useAuth } from 'store/auth'; import cn from 'utils/ts/classNames'; import useBooleanState from 'utils/hooks/useBooleanState'; -import { Link } from 'react-router-dom'; +import { Link, useLocation } from 'react-router-dom'; import { useFilterFriend, useFilterNearby, useFilterScrap } from 'store/filter'; import styles from './SideNavigation.module.scss'; export default function TopNavigation(): JSX.Element { const auth = useAuth(); - const [visible, , , toggle] = useBooleanState(false); + const location = useLocation(); + const [visible, , , toggle, setValue] = useBooleanState(false); const { filterFriendState, setFilterFriend } = useFilterFriend(); const { filterScrapState, setFilterScrap } = useFilterScrap(); const { filterNearbyState, setFilterNearby } = useFilterNearby(); + const handleToggle = () => { + if (location.pathname === '/') { + setValue(!visible); + } + }; + const TABS = [ { name: '', @@ -38,7 +45,7 @@ export default function TopNavigation(): JSX.Element { { name: '글쓰기', icon: , - link: '/post', + link: '/search', }, { name: '마이페이지', @@ -68,7 +75,7 @@ export default function TopNavigation(): JSX.Element {
+ + + ); +} diff --git a/src/pages/Home/components/Map/index.tsx b/src/pages/Home/components/Map/index.tsx index f81fbc57..e039ceaf 100644 --- a/src/pages/Home/components/Map/index.tsx +++ b/src/pages/Home/components/Map/index.tsx @@ -1,4 +1,3 @@ -// import useGeolocation from 'utils/hooks/useGeolocation'; import useMediaQuery from 'utils/hooks/useMediaQuery'; import { useEffect } from 'react'; import { useFilterFriend, useFilterNearby, useFilterScrap } from 'store/filter'; From 98ee7024babb6ac97539bfb02c396ff7dc3838c9 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Wed, 30 Aug 2023 21:04:04 +0900 Subject: [PATCH 43/45] =?UTF-8?q?fix:=20=ED=95=A8=EC=88=98=EB=AA=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/SideNavigation/index.tsx | 2 +- src/layout/DefaultLayout/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/SideNavigation/index.tsx b/src/components/common/SideNavigation/index.tsx index b69342eb..52746ac5 100644 --- a/src/components/common/SideNavigation/index.tsx +++ b/src/components/common/SideNavigation/index.tsx @@ -10,7 +10,7 @@ import { useFilterFriend, useFilterNearby, useFilterScrap } from 'store/filter'; import styles from './SideNavigation.module.scss'; import SpriteSvg from '../SpriteSvg'; -export default function TopNavigation(): JSX.Element { +export default function SideNavigation(): JSX.Element { const auth = useAuth(); const clearAuth = useClearAuth(); const location = useLocation(); diff --git a/src/layout/DefaultLayout/index.tsx b/src/layout/DefaultLayout/index.tsx index 86c4e4ba..dcc7f80a 100644 --- a/src/layout/DefaultLayout/index.tsx +++ b/src/layout/DefaultLayout/index.tsx @@ -1,8 +1,8 @@ import { Outlet, useLocation } from 'react-router-dom'; import BottomNavigation from 'components/common/BottomNavigation'; -import useMediaQuery from 'utils/hooks/useMediaQuery'; import SideNavigation from 'components/common/SideNavigation'; import Home from 'pages/Home'; +import useMediaQuery from 'utils/hooks/useMediaQuery'; import cn from 'utils/ts/classNames'; import styles from './DefaultLayout.module.scss'; From 21d8732f89e40b4871d8f58ed0df06578072f628 Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Sat, 2 Sep 2023 21:30:15 +0900 Subject: [PATCH 44/45] =?UTF-8?q?fix:=20=ED=8C=8C=EC=9D=BC=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/svg/common/menu.svg | 3 --- src/assets/svg/common/{sprite-svg.svg => nav-sprite.svg} | 0 src/components/common/BottomNavigation/index.tsx | 1 - 3 files changed, 4 deletions(-) delete mode 100644 src/assets/svg/common/menu.svg rename src/assets/svg/common/{sprite-svg.svg => nav-sprite.svg} (100%) diff --git a/src/assets/svg/common/menu.svg b/src/assets/svg/common/menu.svg deleted file mode 100644 index ec36294d..00000000 --- a/src/assets/svg/common/menu.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svg/common/sprite-svg.svg b/src/assets/svg/common/nav-sprite.svg similarity index 100% rename from src/assets/svg/common/sprite-svg.svg rename to src/assets/svg/common/nav-sprite.svg diff --git a/src/components/common/BottomNavigation/index.tsx b/src/components/common/BottomNavigation/index.tsx index 6c17ab7c..a3546013 100644 --- a/src/components/common/BottomNavigation/index.tsx +++ b/src/components/common/BottomNavigation/index.tsx @@ -39,7 +39,6 @@ export default function BottomNavigation(): JSX.Element { >
-
{tab.text}
From 6a86cfac0526f82a894bbc70e79a629acd234dde Mon Sep 17 00:00:00 2001 From: Daeeui Kim Date: Mon, 4 Sep 2023 20:03:30 +0900 Subject: [PATCH 45/45] =?UTF-8?q?fix:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=ED=8C=8C=EC=9D=BC=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/search/index.ts | 11 ----------- src/components/common/SpriteSvg/index.tsx | 4 ++-- src/pages/SearchDetails/components/SearchItem.tsx | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) delete mode 100644 src/api/search/index.ts diff --git a/src/api/search/index.ts b/src/api/search/index.ts deleted file mode 100644 index 1c8cc742..00000000 --- a/src/api/search/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { FetchShopsResponse, FetchTrendingsResponse, ShopsParams } from './entity'; -import searchApi from './searchApiClient'; - -export const fetchTrendings = () => searchApi.get('/trending'); - -export const fetchShop = (shopId: string) => searchApi.get(`/shop?place_id=${shopId}`); - -export const fetchShops = (params: ShopsParams) => searchApi.post(`/shops?keyword=${params.keyword}`, { - lat: params.location?.latitude, - lng: params.location?.longitude, -}); diff --git a/src/components/common/SpriteSvg/index.tsx b/src/components/common/SpriteSvg/index.tsx index c0f738c1..4477766e 100644 --- a/src/components/common/SpriteSvg/index.tsx +++ b/src/components/common/SpriteSvg/index.tsx @@ -1,4 +1,4 @@ -import spriteSvg from 'assets/svg/common/sprite-svg.svg'; +import navSpriteSvg from 'assets/svg/common/nav-sprite.svg'; interface SpriteProps { id: string; @@ -9,7 +9,7 @@ interface SpriteProps { export default function SpriteSvg({ id, height = '24', width = '24' }:SpriteProps): JSX.Element { return ( - + ); } diff --git a/src/pages/SearchDetails/components/SearchItem.tsx b/src/pages/SearchDetails/components/SearchItem.tsx index 119dcfae..ca811ae2 100644 --- a/src/pages/SearchDetails/components/SearchItem.tsx +++ b/src/pages/SearchDetails/components/SearchItem.tsx @@ -1,6 +1,6 @@ import styles from 'pages/SearchDetails/SearchDetails.module.scss'; import { useNavigate } from 'react-router-dom'; -import { Shop } from 'api/search/entity'; +import { Shop } from 'api/shop/entity'; import { getMockItem } from '../static/mockup'; interface Props {