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] 메인 페이지 지도 구현 #107

Merged
merged 27 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8320166
fix: 함수명 수정
kimeodml Sep 26, 2023
d5203dd
feat: 마커 클러스터링 아이콘 추가
kimeodml Sep 26, 2023
cbf54f1
feat: 마커 클러스터링 js 파일 추가
kimeodml Sep 26, 2023
b3f85d5
feat: 클러스터 디자인 변경
kimeodml Oct 9, 2023
3c1ee60
fix: 반환값에 markerArray 추가
kimeodml Oct 9, 2023
4684fa9
feat: 마커 클러스터 custom-hook으로 추가
kimeodml Oct 9, 2023
5c48fa3
fix: 사이드바 초기값 true로 변경
kimeodml Oct 9, 2023
3055ccd
feat: 프로필 이미지 추가
kimeodml Oct 9, 2023
4173aa2
fix: 불필요한 div 및 css 제거
kimeodml Oct 9, 2023
390f8be
fix: button 제거
kimeodml Oct 9, 2023
83b20df
fix: 모바일 필터 버튼 수정
kimeodml Oct 9, 2023
db5a127
fix: 이미지 타입 변경
kimeodml Oct 9, 2023
2651e4c
fix: 마커에 음식점 이미지 표시
kimeodml Oct 9, 2023
4021f55
fix: shop.name => shop.photo로 변경
kimeodml Oct 9, 2023
7dc966a
fix: lint 예외 처리
kimeodml Oct 9, 2023
b7b11d1
Merge remote-tracking branch 'origin/develop' into feature/#102
kimeodml Oct 10, 2023
351e301
fix: git 오류 충돌로 파일명 변경
kimeodml Oct 10, 2023
d90e1d6
Merge branch 'develop' into feature/#102
kimeodml Oct 16, 2023
c4f9d04
fix: 프로필 이미지에 optional chaining 추가
kimeodml Oct 17, 2023
173232d
fix : setValue => setVisible로 변경
kimeodml Oct 17, 2023
6eb2187
fix: 인자값 추상화 및 타입 수정
kimeodml Oct 17, 2023
9d610db
fix: 변수명 통일
kimeodml Oct 17, 2023
daa58d9
fix: 불필요한 옵션 제거
kimeodml Oct 17, 2023
4e1f488
fix: url 절대 경로로 변경
kimeodml Oct 17, 2023
a58bda1
Revert "fix: url 절대 경로로 변경"
kimeodml Oct 17, 2023
cfe867a
fix: url 절대경로로 변경
kimeodml Oct 17, 2023
e09cb66
Merge remote-tracking branch 'origin/develop' into feature/#102
kimeodml Oct 23, 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
2 changes: 1 addition & 1 deletion src/api/shop/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface FilterShopsResponse {
location: Coords;
};
name: string;
photo: null | string[];
photo: string;
placeId: string;
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down
6 changes: 6 additions & 0 deletions src/api/user/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export interface User {
// 아래 두 파라미터도 확실한 도메인이 정해지면 수정 필요.
// oauthType = 'KAKAO' | 'NAVER' | 'GOOGLE'...
// userType = 'ADMIN' | 'NORMAL'...
profileImage: {
id: number;
path: string;
originalName: string;
url: string;
}
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
oauthType: string;
userType: string;
userCountResponse: {
Expand Down
Binary file added src/assets/images/home/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 19 additions & 7 deletions src/components/common/SideNavigation/SideNavigation.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@
align-items: center;
list-style: none;

&__profile-image {
width: 48px;
height: 48px;
border-radius: 50%;
border: 1px solid #eeeeee;
}

&__logout {
text-decoration: none;
text-decoration: underline;
Expand Down Expand Up @@ -144,6 +151,10 @@
animation: slide-out 0.3s ease-out forwards;
}

&--invisible {
display: none;
}

@include media.media-breakpoint-down(mobile) {
display: none;
}
Expand All @@ -161,7 +172,11 @@
align-items: center;
}

&__search-input {
&__search-link {
text-decoration: none;
display: flex;
align-items: center;
justify-content: space-between;
width: 405px;
height: 50px;
border-radius: 100px;
Expand All @@ -170,16 +185,13 @@
font-size: 18px;
font-weight: 500;
box-shadow: 2px 3px 12px 1px rgba(0 0 0 / 10%);

&::placeholder {
color: #c4c4c4;
}
color: #c4c4c4;
}

&__search-icon {
position: relative;
top: 4px;
right: 40px;
top: 2px;
right: 20px;

path {
stroke: #ff7f23;
Expand Down
25 changes: 14 additions & 11 deletions src/components/common/SideNavigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ReactComponent as BookMarkIcon } from 'assets/svg/home/bookmark.svg';
import { ReactComponent as GroupIcon } from 'assets/svg/home/group.svg';
import { useAuth, useClearAuth } from 'store/auth';
import cn from 'utils/ts/classNames';
import defaultImage from 'assets/images/follow/default-image.png';
import useBooleanState from 'utils/hooks/useBooleanState';
import { Link, useLocation } from 'react-router-dom';
import { useFilterFriend, useFilterNearby, useFilterScrap } from 'store/filter';
Expand All @@ -14,7 +15,7 @@ export default function SideNavigation(): JSX.Element {
const auth = useAuth();
const clearAuth = useClearAuth();
const location = useLocation();
const [visible, , , toggle, setValue] = useBooleanState(false);
const [visible, , , toggle, setValue] = useBooleanState(true);
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
const { filterFriendState, setFilterFriend } = useFilterFriend();
const { filterScrapState, setFilterScrap } = useFilterScrap();
const { filterNearbyState, setFilterNearby } = useFilterNearby();
Expand Down Expand Up @@ -89,12 +90,14 @@ export default function SideNavigation(): JSX.Element {
<ul className={styles['bottom-navigation']}>
{auth ? (
<li>
<div>
{/* 프로필 사진 추가 */}
<Link to="/" onClick={clearAuth}>
<div className={styles['bottom-navigation__logout']}>로그아웃</div>
</Link>
</div>
<img
src={auth.profileImage.url || `${defaultImage}`}
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
alt="프로필 이미지"
className={styles['bottom-navigation__profile-image']}
/>
<Link to="/" onClick={clearAuth}>
<div className={styles['bottom-navigation__logout']}>로그아웃</div>
</Link>
</li>
) : (
<li>
Expand All @@ -119,14 +122,15 @@ export default function SideNavigation(): JSX.Element {
className={cn({
[styles['side-pannel']]: true,
[styles['side-pannel--expand']]: visible,
[styles['side-pannel--invisible']]: location.pathname !== '/',
})}
>
<div className={styles['side-pannel__search']}>
<div className={styles['side-pannel__search-bar']}>
<span>
<input type="text" placeholder="검색어를 입력해주세요." className={styles['side-pannel__search-input']} />
<Link to="/search" className={styles['side-pannel__search-link']}>
검색어를 입력해주세요.
<SearchIcon className={styles['side-pannel__search-icon']} />
</span>
</Link>
</div>
<div className={styles['side-pannel__search-buttons']}>
<button
Expand Down Expand Up @@ -165,7 +169,6 @@ export default function SideNavigation(): JSX.Element {
</div>
</div>
</div>

</div>
);
}
18 changes: 4 additions & 14 deletions src/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* stylelint-disable value-list-comma-newline-after */
/* stylelint-disable declaration-colon-newline-after */
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
@forward "src/styles/fonts.scss";
@use "src/utils/styles/mediaQuery" as media;

Expand All @@ -9,23 +11,11 @@
body,
html {
/* https://css-tricks.com/snippets/css/system-font-stack/ */
font-family:
SUIT,
system-ui,
"Segoe UI",
Roboto,
Helvetica,
Arial,
sans-serif,
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol";
font-family: SUIT, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body {
min-height: 100vh;
min-width: 1148px;

@include media.media-breakpoint-down(mobile) {
min-width: 320px;
}
Expand Down
1 change: 0 additions & 1 deletion src/pages/Auth/Login/Login.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

.content {
width: 368px;
margin-top: 80px;
margin-bottom: 20px;

@include media.media-breakpoint-down(mobile) {
Expand Down
15 changes: 1 addition & 14 deletions src/pages/Home/Home.module.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
.home {
width: 100%;
}

.map {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}

.locationBox {
position: absolute;
top: 0;
left: 0;
z-index: 3;
z-index: 1;
}
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
box-sizing: content-box;

&__photo img {
background-color: #ffffff;
width: 43px;
height: 43px;
border-radius: 89.5px;
Expand All @@ -57,6 +58,7 @@
}

&__photo--clicked img {
background-color: #ffffff;
width: 56.007px;
height: 55.723px;
border-radius: 89.5px;
Expand Down Expand Up @@ -108,3 +110,24 @@
}
}
}

.cluster {
background-image: url("../../../../../../assets/images/home/location-marker.png");
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
display: flex;
cursor: pointer;
width: 69px;
height: 69px;
font-size: 24px;
color: white;
justify-content: center;
align-items: center;
font-weight: 700;
background-size: contain;

@include media.media-breakpoint-down(mobile) {
width: 48px;
height: 48px;
font-size: 12px;
font-weight: 700;
}
}
40 changes: 22 additions & 18 deletions src/pages/Home/components/Map/components/MarkerHtml/index.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
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 defaultImage from 'assets/images/home/favicon.png';
import styles from './MarkerHtml.module.scss';

export function MarkerHtml(photo:string | null, name:string) {
export function MarkerHtml(photo:string, name:string) {
return `
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
<div class=${styles.container}>
<img src=${MarkerLogo} class=${styles.marker} alt="marker" />
<div class=${styles.bubble}>
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
<div class=${styles.bubble__photo}>
<img src=${Default} alt="사진"/>
</div>
<div class=${styles.bubble__name}>
${name}
</div>
<div class=${styles.bubble}>
<div class=${styles.bubble__photo}>
<img src=${photo || `${defaultImage}`} alt="사진"/>
</div>
<div class=${styles.bubble__name}>
${name}
</div>
</div>
</div>
`;
}

export function ClickedMarkerHtml(photo:string | null, name:string) {
export function ClickedMarkerHtml(photo:string, name:string) {
return `
<div class=${styles.continer}>
<img src=${Selected} class=${styles['marker--clicked']}>
<div class=${styles.bubble}>
<div class=${styles['bubble__photo--clicked']}>
<img src=${Default} alt="사진" />
</div>
<div class=${styles['bubble__name--clicked']}>
${name}
</div>
<div class=${styles.bubble}>
<div class=${styles['bubble__photo--clicked']}>
<img src=${photo || `${defaultImage}`} alt="사진" />
</div>
kimeodml marked this conversation as resolved.
Show resolved Hide resolved
<div class=${styles['bubble__name--clicked']}>
${name}
</div>
</div>
`;
</div>
`;
}

export function ClusterHtml() {
return `<div class=${styles.cluster}></div>`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
position: absolute;
display: grid;
grid-template-columns: 1fr auto;
gap: 50px;
gap: 55px;
top: 20px;
left: 50%;
transform: translate(-50%);
Expand All @@ -24,7 +24,8 @@
padding-right: 15px;
}

&__filter {
&__icon {
display: flex;
width: 48px;
height: 48px;
background-color: #ffffff;
Expand All @@ -35,30 +36,33 @@
position: absolute;
top: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;

&--clicked {
svg path {
&--changed {
path {
stroke: #ff7f23;
}
}
}
}

&__list {
display: flex;
float: right;
flex-direction: column;
justify-content: space-around;
width: 118px;
height: 78px;
border-radius: 15px;
opacity: 0.8;
border: 1px solid #eeeeee;
background-color: #ffffff;
box-shadow: 2px 3px 12px 1px rgba(0 0 0 / 10%);
}
.filter {
display: flex;
position: absolute;
right: 0;
top: 60px;
float: right;
flex-direction: column;
justify-content: space-around;
width: 118px;
height: 78px;
border-radius: 15px;
opacity: 0.8;
border: 1px solid #eeeeee;
background-color: #ffffff;
box-shadow: 2px 3px 12px 1px rgba(0 0 0 / 10%);

&__text {
display: flex;
Expand Down
Loading
Loading