codestates / codestates/aneun-dongne
[Dev-Log ] 12/17 류준열
- Dominant language
- JavaScript
- Stars
- 6
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
> ### 오늘은 어떻게 프로젝트에 기여했나요?
> 홈화면 반응형, 홈화면에 좋아요기능 추가,
> ### 오늘의 프로젝트에서 힘든 점은 무엇인가요?
> * 항목별로 적어주세요.
> - 반응형
> - 마이페이지 내가가본곳에 있는 지도에서 마커 누르면 에러뜨는 현상 해결 -> 저번 배열map에서 모달사용이랑 같은원리이다.
> 한 state에 배열인덱스를 통째로 넣어준 후, 배열 인덱스가 들어간 state를 모달컴포넌트에 props로 전달.
`setSelectedPosition()`에 원하는 인덱스`position[i]`를 할당하고 `selectiedPostion`을 하위컴퍼넌트에 전달했다.


하위컴퍼넌트인 `VisitedList.js`에서 `useEffect()`를 사용하여 `selectedPosition`이 업데이트될때마다 `openModalHandler()`가 실행되도록 한다. 이때 `useEffect()`의 두번째 인자에 `selectedPosition`만 넣으면 같은 항목을 연속해서 고를때는 값이 바뀌지 않은것으로 읽히기 때문에, 클릭했다는 `boolean`신호 `merkerClick`도 같이 넣어주었다.
=> 수정 : 순수함수가 되도록 `markerClick`만 넣어주었다. 오로지 `markerClick` 즉, 클릭유무에 의해서만 결과가 결정된다.

`openModalHandler()`를 통해 모달창이 켜진다.

모달창의 props에는 selectedModal이 전달된다.

>
> ### 내일은 프로젝트에 기여하기 위해 무엇을 해야 하나요?
> * [ ] 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