Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Map] 메인 페이지 지도 구현, 메인 페이지 지도 기능 추가 #92

Merged
merged 47 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3e5db18
refactor: TopNavigation => SideNavigation으로 변경
kimeodml Jul 30, 2023
ab2a69e
chore: 로고, 메뉴 svg 추가
kimeodml Jul 30, 2023
4c98dcb
fix: 지도 옵션, 크기 수정
kimeodml Jul 30, 2023
915d757
fix: 사이드바로 디자인 변경
kimeodml Jul 30, 2023
a438b28
feat: 사이드바 판넬의 검색창과 옵션 버튼 추가
kimeodml Jul 30, 2023
fc4b173
fix: 글쓰기, 마이페이지 경로 변경 및 디자인 수정
kimeodml Jul 30, 2023
2cb27ab
style: 모바일 UI 추가
kimeodml Jul 30, 2023
8065ad9
chore: 판넬 버튼 이미지 추가
kimeodml Jul 30, 2023
750675a
feat: 판넬 열고, 닫는 버튼 추가
kimeodml Jul 30, 2023
7afb96c
refactor: search => shop으로 변경
kimeodml Aug 1, 2023
b2a3fcb
feat: 필터 상점 타입 지정
kimeodml Aug 6, 2023
5c53817
feat: 'shops/maps' api 연결
kimeodml Aug 6, 2023
294cbed
feat: useFilterShops 함수 생성
kimeodml Aug 6, 2023
10758af
feat: 지도 부분 custom-hook으로 변경
kimeodml Aug 6, 2023
c0972ca
Merge branch 'develop' into feature/#44
kimeodml Aug 6, 2023
df6543e
fix: useGeolocation 타입명 수정
kimeodml Aug 6, 2023
a957c5e
fix: filterShopsListResponse로 변경
kimeodml Aug 6, 2023
5d93665
fix: fetchShops, getfilterShops api 수정
kimeodml Aug 6, 2023
d1bbfc7
fix: params에서 location 제외
kimeodml Aug 6, 2023
0cb42f9
fix: latitude => lat, longitude => lng로 변경
kimeodml Aug 6, 2023
9fd518a
fix: 인자에서 index 제거
kimeodml Aug 7, 2023
812c7a4
refactor: OptionButtons 컴포넌트 제거
kimeodml Aug 7, 2023
84067d3
feat: 지도 및 마커 custom-hook으로 변경
kimeodml Aug 7, 2023
5324bf0
fix: shop/maps 응답 데이터에 맞게 더미 데이터 값 변경
kimeodml Aug 7, 2023
1fff93e
fix: 타입으로 변경
kimeodml Aug 8, 2023
92fc0be
fix: 불필요한 목업 데이터 제거
kimeodml Aug 8, 2023
cc30877
fix: 이미지 타입 변경
kimeodml Aug 12, 2023
20cc901
fix: 지도 줌 레벨 변경
kimeodml Aug 12, 2023
1d51dfe
style: 좌표에 맞게 위치 수정
kimeodml Aug 12, 2023
bad40cd
fix: png 파일 변경
kimeodml Aug 12, 2023
24872da
style: 클릭된 마커 디자인 수정
kimeodml Aug 12, 2023
ca6f2ee
fix: 목업 데이터 구조 변경
kimeodml Aug 12, 2023
ecad2ac
feat: 마커 custom-hook으로 변경
kimeodml Aug 12, 2023
8e1ef4d
fix: zIndex를 활용해 마커 우선순위 지정
kimeodml Aug 12, 2023
f127d7a
feat: 마커에 핀 컴포넌트 추가
kimeodml Aug 12, 2023
d197c9a
fix: api url 수정
kimeodml Aug 13, 2023
a3a84a3
fix: 버튼 전역 상태로 변경
kimeodml Aug 13, 2023
2ce7c01
fix: MenuIcon 제거 및 디자인 수정
kimeodml Aug 13, 2023
cf0577e
fix: enabled 옵션 수정
kimeodml Aug 13, 2023
d57a01f
fix: 경로에 따라 토글 상태 변경
kimeodml Aug 21, 2023
d2bfb7d
fix: 로그인, 로그아웃 UI 수정
kimeodml Aug 21, 2023
09caa7f
fix: 현재 위치 전역으로 관리
kimeodml Aug 28, 2023
9df5b9e
fix: sprite svg로 변경
kimeodml Aug 28, 2023
98ee702
fix: 함수명 수정
kimeodml Aug 30, 2023
21d8732
fix: 파일명 변경
kimeodml Sep 2, 2023
ae3a9c3
Merge remote-tracking branch 'origin/develop' into feature/#44
kimeodml Sep 4, 2023
6a86cfa
fix: 불필요한 파일 제거 및 수정
kimeodml Sep 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/api/search/index.ts

This file was deleted.

22 changes: 20 additions & 2 deletions src/api/search/entity.ts → src/api/shop/entity.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
export interface FilterShopsParams {
options_friend: 0 | 1;
options_nearby: 0 | 1;
options_scrap: 0 | 1;
location?: Coords;
}

export interface FilterShopsResponse {
geometry: {
location: Coords;
};
name: string;
photo: null | string[];
placeId: string;
}

export type FilterShopsListResponse = FilterShopsResponse[];

export interface FetchTrendingsResponse {
trendings: string[]
}
Expand Down Expand Up @@ -30,6 +48,6 @@ export interface Shop {
}

export interface Coords {
latitude: number,
longitude: number
lat: number | undefined;
lng: number | undefined;
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
}
19 changes: 19 additions & 0 deletions src/api/shop/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
Coords, FetchShopsResponse, FetchTrendingsResponse, FilterShopsParams,
FilterShopsListResponse, ShopsParams,
} from './entity';
import shopApi from './shopApiClient';

export const fetchTrendings = () => shopApi.get<FetchTrendingsResponse>('/trending');

export const fetchShop = (shopId: string) => shopApi.get(`/shop?place_id=${shopId}`);

export const fetchShops = (params: ShopsParams) => shopApi.post<FetchShopsResponse>(`/shops?keyword=${params.keyword}`, {
lat: params.location?.lat,
lng: params.location?.lng,
});

export const getfilterShops = (params: FilterShopsParams, location: Coords) => shopApi.post<FilterShopsListResponse>(`/shops/maps?options_friend=${params.options_friend}&options_nearby=${params.options_nearby}&options_scrap=${params.options_scrap}`, {
lat: location.lat,
lng: location.lng,
});
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,4 +15,4 @@ searchApi.interceptors.request.use(
},
);

export default searchApi;
export default shopApi;
Binary file modified src/assets/images/home/selected-marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/assets/svg/common/home.svg

This file was deleted.

4 changes: 0 additions & 4 deletions src/assets/svg/common/my-page.svg

This file was deleted.

27 changes: 27 additions & 0 deletions src/assets/svg/common/nav-sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions src/assets/svg/common/setting.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/svg/common/write.svg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
left: 0;
width: 100%;
height: 80px;
background-color: #ffffff;
}

.tab {
Expand Down
46 changes: 24 additions & 22 deletions src/components/common/BottomNavigation/index.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import { ReactComponent as HomeIcon } from 'assets/svg/common/home.svg';
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: '마이페이지',
},
];
import SpriteSvg from '../SpriteSvg';

export default function BottomNavigation(): JSX.Element {
const { pathname } = useLocation();
const auth = useAuth();

const NAV_TABS = [
{
pathname: '/',
icon: 'home',
text: '홈',
},
{
pathname: '/post',
icon: 'write',
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
text: '글쓰기',
},
{
pathname: auth ? '/profile' : '/login',
icon: 'my-page',
text: '마이페이지',
},
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
];

return (
<nav className={styles['bottom-navigation']}>
Expand All @@ -38,7 +38,9 @@ export default function BottomNavigation(): JSX.Element {
})}
>
<Link className={styles.tab__link} to={tab.pathname}>
<tab.icon className={styles.tab__icon} aria-hidden />
<div className={styles.tab__icon}>
<SpriteSvg id={`${tab.icon}`} />
</div>
<div className={styles.tab__text}>{tab.text}</div>
</Link>
</li>
Expand Down
Loading
Loading