Skip to content

Seongil week4 hw#6

Open
Atipico1 wants to merge 2 commits intoseongilfrom
seongil-week4-hw
Open

Seongil week4 hw#6
Atipico1 wants to merge 2 commits intoseongilfrom
seongil-week4-hw

Conversation

@Atipico1
Copy link

@Atipico1 Atipico1 commented Apr 1, 2024

💎 과제 구현 설명

과제를 위해 사용했던 함수, 수정한 파일 등 구현 내용에 대한 간단한 설명을 작성해 주세요.

  • useParams 함수
  • find 함수
  • postid를 useParams에서 전달받아 find로 해당하는 post 찾기

🏁 PR 체크리스트

  • [ V ] 코드가 오류 없이 정상적으로 실행되나요?
  • [ V ] 커밋 메시지 컨벤션(템플릿 활용)을 준수했나요?
  • [ V ] 과제 마감기한을 준수했나요?

🖼️ Screenshot / Video

image

🙌 Issue

과제 수행 중 어려웠던 부분이나 궁금했던 점을 자유롭게 작성해 주세요.

  • useEffect와 useState를 쓰면 postId가 제대로 파싱이 안되는데 이유를 모르겠습니다..

@Atipico1 Atipico1 self-assigned this Apr 1, 2024
Copy link

@Yeonghunj Yeonghunj left a comment

Choose a reason for hiding this comment

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

잘 구현하신 것 같아요! 수고하셨습니당

cheeze-hyeon pushed a commit that referenced this pull request Apr 6, 2024
Feat: 페이지 파일 다 생성
<div className="grid grid-cols-4 px-10 mt-10">
{postList.map((post) => (
<SmallPost key={post.id} post={post} />
<Link to={"/" + post.id}>
Copy link

@kimnamheeee kimnamheeee Apr 6, 2024

Choose a reason for hiding this comment

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

�SmallPost 컴포넌트 자체가 Link로 감싸져 있기 때문에 여기서는 Link로 감싸지 않아도 컴포넌트를 눌렀을 때 PostDetailPage로 이동합니다 !!

Comment on lines +10 to +12
*이름:
</label>
<input required type="text" id="username" className="input" />

Choose a reason for hiding this comment

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

이 부분에 사용자가 이메일을 입력하게 되어있는 만큼 코드에도 기능을 반영해서 일관성을 유지해 주는 건 어떨까요!!

Suggested change
*이름:
</label>
<input required type="text" id="username" className="input" />
*이메일:
</label>
<input required type="text" id="email" className="input" />

};

export const BigPost = ({ post }) => {
const likeBtnClick = () => {

Choose a reason for hiding this comment

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

이 함수는 좋아요를 누르는 이벤트가 발생했을 때 호출되는 함수인데요 ! 이런 이벤트 핸들러 함수는 보통 handle어쩌구로 이름을 짓는 것이 일반적입니다 ~ 참고해 주세요 !

Suggested change
const likeBtnClick = () => {
const handleLike = () => {

Choose a reason for hiding this comment

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

너무 야무지네요

</label>
<input
required
value={post.title}

Choose a reason for hiding this comment

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

이렇게 설정하면 아마 값 수정이 안 될 거예요! defaultValue 속성을 사용해 봐요 ~

Suggested change
value={post.title}
defaultValue={post.title}

</label>
<input
className="h-64 input"
value={post.content}

Choose a reason for hiding this comment

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

여기도 마찬가지로 defaultValue를 쓰면 좋을 것 같아요!

Suggested change
value={post.content}
defaultValue={post.content}

Copy link

@kimnamheeee kimnamheeee left a comment

Choose a reason for hiding this comment

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

코드가 야무지고 좋네요!!! 과제 하느라 수고 많으셨습니다 ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants