{isMobile && }
{isMobile ? !isSearching && : }
-
+
{isMobile ? !isSearching && : }
diff --git a/src/pages/SearchDetails/SearchDetails.module.scss b/src/pages/SearchDetails/SearchDetails.module.scss
index c0a050fe..0a68a61f 100644
--- a/src/pages/SearchDetails/SearchDetails.module.scss
+++ b/src/pages/SearchDetails/SearchDetails.module.scss
@@ -139,6 +139,8 @@
font-size: 16px;
text-decoration: none;
color: black;
+ text-align: start;
+ cursor: pointer;
&:hover {
background-color: #eeeeee;
diff --git a/src/pages/SearchDetails/components/SearchItem.tsx b/src/pages/SearchDetails/components/SearchItem.tsx
index 99de0a44..119dcfae 100644
--- a/src/pages/SearchDetails/components/SearchItem.tsx
+++ b/src/pages/SearchDetails/components/SearchItem.tsx
@@ -1,37 +1,57 @@
import styles from 'pages/SearchDetails/SearchDetails.module.scss';
-import { ReactComponent as MapIcon } from 'assets/svg/search/map.svg';
-import defaultImage from 'assets/images/search/default-image.png';
+import { useNavigate } from 'react-router-dom';
+import { Shop } from 'api/search/entity';
+import { getMockItem } from '../static/mockup';
interface Props {
- shop: {
- address: string,
- placeName: string,
- shopId: number,
- },
+ shop: Shop;
}
export default function SearchItem({ shop }: Props) {
- const { placeName, address } = shop;
+ const {
+ name, formattedAddress, photoToken, placeId, dist, openNow,
+ } = shop;
+ const {
+ imageAlt, defaultImage, phoneNumber, image,
+ } = getMockItem();
+ const navigate = useNavigate();
+
return (
-
-
+
+
);
}
diff --git a/src/pages/SearchDetails/components/SearchItemPC.tsx b/src/pages/SearchDetails/components/SearchItemPC.tsx
deleted file mode 100644
index 80fb62ff..00000000
--- a/src/pages/SearchDetails/components/SearchItemPC.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import styles from 'pages/SearchDetails/SearchDetails.module.scss';
-import { Link } from 'react-router-dom';
-import { getMockItem, SHOPS } from '../static/mockup';
-
-interface Props {
- shop: {
- address: string,
- placeName: string,
- shopId: number,
- },
-}
-
-export default function SearchItemPC({ shop }: Props) {
- const { placeName, address } = shop;
- const {
- imageAlt, defaultImage, phoneNumber, image,
- } = getMockItem();
-
- return (
-
-
-
-
-
-
-
- {placeName}
- {address}
-
-
-
-
- );
-}
diff --git a/src/pages/SearchDetails/hooks/useFetchShops.ts b/src/pages/SearchDetails/hooks/useFetchShops.ts
index 438efcf0..91ec13f7 100644
--- a/src/pages/SearchDetails/hooks/useFetchShops.ts
+++ b/src/pages/SearchDetails/hooks/useFetchShops.ts
@@ -14,7 +14,7 @@ const useFetchShops = (keyword: string) => {
} = useQuery('shop', () => fetchShops(params as ShopsParams), { enabled: !!location });
const isFetching = isLoading || !(location);
- const shops = data?.data.content;
+ const shops = data?.data.shopQueryResponseList;
return {
isFetching, isError, data: shops, refetch,
diff --git a/src/pages/SearchDetails/index.tsx b/src/pages/SearchDetails/index.tsx
index ca4758e5..01968fe0 100644
--- a/src/pages/SearchDetails/index.tsx
+++ b/src/pages/SearchDetails/index.tsx
@@ -4,7 +4,7 @@ import NavigationBar from 'pages/Search/components/NavigationBar';
import LoadingView from './components/LoadingView';
import useFetchShops from './hooks/useFetchShops';
import ControllBar from './components/ControllBar';
-import SearchItemPC from './components/SearchItemPC';
+import SearchItem from './components/SearchItem';
export default function SearchDetails() {
const { keyword } = useParams();
@@ -19,7 +19,7 @@ export default function SearchDetails() {
{isFetching
?
: shops && shops.map((shop) => (
-
+
))}