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

프로필 화면에서 팔로우 버튼 활성화, 기타 관련 기능 구현 #99

Merged
merged 12 commits into from
Nov 19, 2021

Conversation

iHoHyeon
Copy link
Member

개요

작업사항

  • 프로필 뷰에서 팔로우 기능이 활성화 되었습니다.
  • Room에서 사용자의 프로필을 클릭하면서 이동하면 생기던 버그를 수정했습니다.
  • 아이템들의 hover 스타일을 추가해줬습니다.
  • userCard에서 userId를 보여주도록 하였습니다.
  • userCard를 클릭하면 프로필 화면으로 이동합니다. (채팅에서는 제외)
  • 프로필 화면에서 뒤로가기 버튼을 기존 "홈으로 이동" 에서 "뒤로 가기" 로 변경했습니다. (팔로우 페이지도 동일)

변경 후

팔로우

@iHoHyeon iHoHyeon added 🐛 bug 구현중 발생하는 버그중 아직 해결하지 못한 부분 ✨ feature 기능 개발 관련 이슈 labels Nov 18, 2021
@iHoHyeon iHoHyeon self-assigned this Nov 18, 2021
Copy link
Member

@NEM-NE NEM-NE left a comment

Choose a reason for hiding this comment

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

짧은 시간에 많은 기능을 구현하셨네요 ㅎㅎ
고생하셨습니다!

setLoading(false);
});
}, []);
console.log(props.userData);
Copy link
Member

Choose a reason for hiding this comment

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

앗 콘솔로그가 찍혀있네요 ㅋㅋㅋㅋㅌ

Copy link
Member Author

Choose a reason for hiding this comment

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

헉 확인을 못했네요 ㅜ


return (
<UserCardLayout sizeType={props.cardType}>
<UserCardLayout onClick={() => props.cardType !== 'others' && history.push(`/profile/${props.userData.userId}`)} sizeType={props.cardType}>
Copy link
Member

Choose a reason for hiding this comment

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

오늘 Link로 하면 스타일 이슈가 생길 수도 있다고 하셨는데 그래서 history를 사용한건가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

props.cardType이 others인 경우에는 링크가 걸리면 안되서 히스토리 사용했습니다!

Comment on lines +16 to +23
fetch(`${process.env.REACT_APP_API_URL}/api/user/follow`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
credentials: 'include',
body: JSON.stringify({ type, targetUserDocumentId }),
}).then((res) => res.json())
Copy link
Member

Choose a reason for hiding this comment

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

API 폴더에 빼도 좋을 거 같습니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

네네 오늘 리팩토링 해볼게요!

Comment on lines +16 to +23
description: string,
profileUrl: string,
isFollow?: boolean,
}

function FollowerView({ match }: RouteComponentProps<{id: string}>) {
const userId = match.params.id;
const [nowItemList, nowItemType] = useFetchItems<any>(`/user/followers/${userId}`, 'followers');
const [nowItemList, nowItemType] = useFetchItems<Required<IUserForCard>>(`/user/followers/${userId}`, 'followers');
Copy link
Member

Choose a reason for hiding this comment

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

오 Require도 있군요! 배워갑니다 ㅎㅎㅎ

Comment on lines +11 to +18
interface IUserForCard{
_id: string,
userName: string,
userId: string,
description: string,
profileUrl: string,
isFollow?: boolean,
}
Copy link
Member

Choose a reason for hiding this comment

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

follower-view에도 있는 인터페이스네요 저도 종종 자주 쓰이는 인터페이스가 있는데 저런 공통부분을 폴더를 만들어서 관리할까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

여러곳에서 쓰이는 interface는 폴더를 만들면 좋겠다는 생각이 듭니다!

@iHoHyeon iHoHyeon merged commit 8487007 into boostcampwm-2021:dev Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug 구현중 발생하는 버그중 아직 해결하지 못한 부분 ✨ feature 기능 개발 관련 이슈
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants