-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from themoment-team/feature/infoWindow
[Client] 찾아오는길 infoWindow 제작
- Loading branch information
Showing
15 changed files
with
375 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
apps/client/public/images/about/Location/svg/CopyLinkIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
apps/client/public/images/about/Location/svg/SmallMarkerIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
apps/client/src/components/About/Location/Map/InfoWindow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import Image from 'next/image'; | ||
|
||
import * as S from './style'; | ||
interface InfoWindowProps { | ||
latitude: number; | ||
longitude: number; | ||
onClose: () => void; | ||
} | ||
|
||
const InfoWindow: React.FC<InfoWindowProps> = ({ | ||
latitude, | ||
longitude, | ||
onClose, | ||
}) => { | ||
const CloseButtonClick = () => { | ||
onClose(); | ||
}; | ||
|
||
const copyLinkButtonClick = () => { | ||
const linkToCopy = 'http://kko.to/CtKpnV33Dj'; | ||
navigator.clipboard.writeText(linkToCopy).then(() => { | ||
alert('링크가 복사되었습니다'); | ||
}); | ||
}; | ||
|
||
return ( | ||
<S.Next> | ||
<S.Box> | ||
<S.Close> | ||
<Image | ||
alt='closeIcon' | ||
width={20} | ||
height={20} | ||
src='/images/about/location/svg/CloseIcon.svg' | ||
onClick={CloseButtonClick} | ||
/> | ||
</S.Close> | ||
<S.ContentBox> | ||
<S.Title>광주소프트웨어마이스터고등학교</S.Title> | ||
<S.Address>광주 광산구 상무대로 312 </S.Address> | ||
<div> (우) 62423 (지번) 송정동 710-3</div> | ||
<S.Number>062-949-6800</S.Number> | ||
</S.ContentBox> | ||
<S.BottomBox> | ||
<S.IconBox> | ||
<a | ||
href={`https://map.kakao.com/link/roadview/${latitude},${longitude}`} | ||
target='_blank' | ||
> | ||
<S.Icon> | ||
<Image | ||
width={16} | ||
height={16} | ||
alt='smallMarker' | ||
src='/images/about/location/svg/SmallMarkerIcon.svg' | ||
/> | ||
</S.Icon> | ||
</a> | ||
<S.Icon onClick={copyLinkButtonClick}> | ||
<Image | ||
width={16} | ||
height={16} | ||
alt='CopyLinkIcon' | ||
src='/images/about/location/svg/CopyLinkIcon.svg' | ||
/> | ||
</S.Icon> | ||
</S.IconBox> | ||
<a | ||
href={`https://map.kakao.com/link/to/광주소프트웨어마이스터고등학교,${latitude},${longitude}`} | ||
target='_blank' | ||
> | ||
<S.LocationBtn>길찾기</S.LocationBtn> | ||
</a> | ||
</S.BottomBox> | ||
</S.Box> | ||
<S.Triangle2 /> | ||
</S.Next> | ||
); | ||
}; | ||
|
||
export default InfoWindow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React, { useState } from 'react'; | ||
|
||
import Image from 'next/image'; | ||
|
||
import InfoWindow from './InfoWindow'; | ||
import * as S from './style'; | ||
|
||
interface OverlayProps { | ||
latitude: number; | ||
longitude: number; | ||
} | ||
|
||
const Overlay: React.FC<OverlayProps> = ({ latitude, longitude }) => { | ||
const [isInfoWindowVisible, setIsInfoWindowVisible] = useState(false); | ||
const [isCustomOverlayVisible, setIsCustomOverlayVisible] = useState(true); | ||
|
||
const isOverlay = () => { | ||
setIsInfoWindowVisible(!isInfoWindowVisible); | ||
setIsCustomOverlayVisible(!isCustomOverlayVisible); | ||
}; | ||
|
||
const onCloseInfoWindow = () => { | ||
setIsInfoWindowVisible(false); | ||
setIsCustomOverlayVisible(true); | ||
}; | ||
|
||
return ( | ||
<div> | ||
{isCustomOverlayVisible && ( | ||
<S.CustomOverlay> | ||
<S.Default onClick={isOverlay}> | ||
<S.MarkerIcon> | ||
<Image | ||
width={20} | ||
height={20} | ||
alt='markerIcon' | ||
src='/images/about/location/svg/MarkerIcon.svg' | ||
/> | ||
</S.MarkerIcon> | ||
<S.Title>광주소프트웨어마이스터고등학교</S.Title> | ||
<S.Chevron> | ||
<Image | ||
width={20} | ||
height={20} | ||
alt='chevronIcon' | ||
src='/images/about/location/svg/ChevronIcon.svg' | ||
/> | ||
</S.Chevron> | ||
</S.Default> | ||
<S.Triangle /> | ||
</S.CustomOverlay> | ||
)} | ||
{isInfoWindowVisible && ( | ||
<InfoWindow | ||
latitude={latitude} | ||
longitude={longitude} | ||
onClose={onCloseInfoWindow} | ||
/> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Overlay; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
e1f41d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
official-gsm-storybook – ./
official-gsm-storybook.vercel.app
storybook.hellogsm.kr
official-gsm-storybook-git-develop-the-moment.vercel.app
official-gsm-storybook-the-moment.vercel.app
e1f41d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
test-official-gsm-client – ./
test-official-gsm-client.vercel.app
test-official-gsm-client-the-moment.vercel.app
test-official-gsm-client-git-develop-the-moment.vercel.app
test.official.hellogsm.kr
e1f41d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
test-official-gsm-admin – ./
test-official-gsm-admin.vercel.app
test-official-gsm-admin-git-develop-the-moment.vercel.app
test-official-gsm-admin-the-moment.vercel.app
test.admin.official.hellogsm.kr
e1f41d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
official-gsm-admin – ./
official-gsm-front-admin.vercel.app
official-gsm-admin-git-develop-the-moment.vercel.app
official-gsm-admin-the-moment.vercel.app
admin.official.hellogsm.kr