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

feat: 모집 상세 페이지 지도위에 코스 나타내기 성공 #101

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

pushedrumex
Copy link
Member

@pushedrumex pushedrumex commented Nov 24, 2022

Feature

  • 배경
    모집 상세 페이지 지도에 러닝 코스를 나타낸다.
  • 목적
    사용자에게 대략적인 러닝 코스를 제공하기 위함

과정

  • 서버에서 응답해준 path를 통해 위도경도를 찍어가며 지도 위에 나타낸다.

결과 (스크린샷 등)

스크린샷 2022-11-25 오전 6 31 46

관련 issue 번호 (링크)

#82

테스트 방법

GET http://localhost:3000/recruit/1

Commit

const container = useRef<HTMLDivElement>(null);
const map = useRef<kakao.maps.Map>();
const polyLineRef = useRef<kakao.maps.Polyline>();
const [path, setPath] = useState<kakao.maps.LatLng[]>([]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showMap에서는 path를 state로 관리할 필요가 없는 것 같아요

const getLaMaByLatLng = (point: LatLng): kakao.maps.LatLng => {
return new kakao.maps.LatLng(point.lat, point.lng);
};
const DrawPath = useCallback(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DrawPath() -> drawPath()

Comment on lines 86 to +90
setAuthor(response.userId);
setMaxPpl(response.maxPpl);
setCurrentPpl(response.currentPpl);
setPath(JSON.parse(response.path));
setMiddlePoint(getMiddlePoint(JSON.parse(response.path)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const [recruit, setRecruit] = useState<Recruit>();
// ...
const response = await get(`/recruit/${id}`);
setRecruit(response);
// ...

@pushedrumex pushedrumex self-assigned this Nov 24, 2022
@June1010 June1010 self-requested a review November 24, 2022 21:53
Copy link
Member

@June1010 June1010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM:D

@gchoi96 gchoi96 merged commit 150fc7a into develop Nov 24, 2022
@pushedrumex pushedrumex deleted the feat/recruit-detail-fe branch December 1, 2022 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants