codestates / codestates/aneun-dongne

[Dev-Log ] 12/17 류준열

Open
#163 0 comments 0 reactions 0 assignees View on GitHub
Dev Log
Dominant language
JavaScript
Stars
6
Forks
7
PR merge metrics
No merged PRs in 30d

Description

> ### 오늘은 어떻게 프로젝트에 기여했나요?
> 홈화면 반응형, 홈화면에 좋아요기능 추가,
> ### 오늘의 프로젝트에서 힘든 점은 무엇인가요?
> * 항목별로 적어주세요.
> - 반응형
> - 마이페이지 내가가본곳에 있는 지도에서 마커 누르면 에러뜨는 현상 해결 -> 저번 배열map에서 모달사용이랑 같은원리이다.
> 한 state에 배열인덱스를 통째로 넣어준 후, 배열 인덱스가 들어간 state를 모달컴포넌트에 props로 전달.

`setSelectedPosition()`에 원하는 인덱스`position[i]`를 할당하고 `selectiedPostion`을 하위컴퍼넌트에 전달했다.
스크린샷 2021-12-18 오전 1 34 41

스크린샷 2021-12-18 오전 1 35 04

하위컴퍼넌트인 `VisitedList.js`에서 `useEffect()`를 사용하여 `selectedPosition`이 업데이트될때마다 `openModalHandler()`가 실행되도록 한다. 이때 `useEffect()`의 두번째 인자에 `selectedPosition`만 넣으면 같은 항목을 연속해서 고를때는 값이 바뀌지 않은것으로 읽히기 때문에, 클릭했다는 `boolean`신호 `merkerClick`도 같이 넣어주었다.
스크린샷 2021-12-18 오전 1 37 49
=> 수정 : 순수함수가 되도록 `markerClick`만 넣어주었다. 오로지 `markerClick` 즉, 클릭유무에 의해서만 결과가 결정된다.
![스크린샷 2021-12-23 오후 1 08 56](https://user-images.githubusercontent.com/66232436/147186675-34bedc01-4825-4bf5-b404-d73641317c1b.png)

`openModalHandler()`를 통해 모달창이 켜진다.
스크린샷 2021-12-18 오전 1 38 42

모달창의 props에는 selectedModal이 전달된다.
스크린샷 2021-12-18 오전 1 39 09

>
> ### 내일은 프로젝트에 기여하기 위해 무엇을 해야 하나요?
> * [ ] 11시전까지 관심사분리 마치기,

Contributor guide

No contributing guide indexed for this repository

Research direction

The log mentions VisitedList.js, setSelectedPosition(), useEffect(), and openModalHandler() while describing completed home and map-modal work. Start by reviewing that component and the related issue history; no remaining change or completion criterion is stated, so confirm scope with maintainers before proceeding.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.