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

친구 검색 시 팔로우 / 팔로잉 버튼이 보이도록 구현 #70

Merged
merged 4 commits into from
Mar 6, 2024

Conversation

soopeach
Copy link
Member

😎 작업 내용

  • 친구 검색 시 팔로우 / 팔로잉 버튼이 보이도록 구현

🧐 변경된 내용

  • SearchedFriendItem 내부 이슈 해결

🥳 동작 화면

Screenshot 2024-02-29 at 1 32 14 AM

🤯 이슈 번호

  • 이슈 없음

🥲 비고

  • 비고 없음

@soopeach soopeach requested a review from yonghanJu February 28, 2024 16:57
Copy link

@mangbaam mangbaam left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

Comment on lines 159 to 188
if (item.isFollowing) {
Box(modifier = Modifier
.clip(RoundedCornerShape(10.dp))
.background(Color(0xFFE4E4E4))
.clickable {
viewModel.unFollow(item.user)
}
.padding(horizontal = 12.dp, vertical = 5.dp)) {
Text(
text = "팔로잉",
style = WalkieTypography.Body2,
)
}
} else {
Box(modifier = Modifier
.clip(RoundedCornerShape(10.dp))
.background(WalkieColor.Primary)
.clickable {
viewModel.follow(item.user)
}
.padding(horizontal = 12.dp, vertical = 5.dp)) {
Text(
text = "팔로우",
style = WalkieTypography.Body2.copy(
Color.White
),
)
}
}
}

Choose a reason for hiding this comment

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

색상과 문자열 빼곤 컴포넌트의 모양과 액션이 동일하기 때문에 별도의 컴포저블로 분리하는게 어떨까 싶습니다 😎

Suggested change
if (item.isFollowing) {
Box(modifier = Modifier
.clip(RoundedCornerShape(10.dp))
.background(Color(0xFFE4E4E4))
.clickable {
viewModel.unFollow(item.user)
}
.padding(horizontal = 12.dp, vertical = 5.dp)) {
Text(
text = "팔로잉",
style = WalkieTypography.Body2,
)
}
} else {
Box(modifier = Modifier
.clip(RoundedCornerShape(10.dp))
.background(WalkieColor.Primary)
.clickable {
viewModel.follow(item.user)
}
.padding(horizontal = 12.dp, vertical = 5.dp)) {
Text(
text = "팔로우",
style = WalkieTypography.Body2.copy(
Color.White
),
)
}
}
}
@Composable
private fun followButton(
modifier: Modifier = Modifier,
isFollowing: Boolean,
onClick: () -> Unit,
) {
Box(
modifier = modifier
.clip(RoundedCornerShape(10.dp))
.background(if(isFollowing) Color(0xFFE4E4E4) else WalkieTypography.Body2)
.padding(horizontal = 12.dp, vertical = 6.dp)
.clickable(onClick = onClick),
) {
Text(
text = if (isFollowing) "팔로잉" else "팔로우",
style = WalkieTypography.Body2,
color = if(isFollowing) Color.Black else Color.White,
)
}

Copy link
Member Author

Choose a reason for hiding this comment

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

@mangbaam
오예~ 명범님 감사합니다~~! ㅋㅋㅋㅋㅋㅋㅋ

Comment on lines 31 to 33
style = WalkieTypography.Body2.copy(
Color.White
),

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.

아.. 그러네요,,, 감사해요 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋㅋㅋ KMP 기대하고 있겠습니다~ ㅋㅋㅋ

Copy link
Member Author

Choose a reason for hiding this comment

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

아.. ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ 하게되면 알려드릴게요,,, ㅋㅋㅋㅋㅋㅋ
다른 거 KMP로 만들고 있긴한데 파이어베이스쪽만 문제라서

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.

ㅋㅋㅋㅋㅋ 화이팅입니다 >< 리뷰해주셔서 감사해요~~!!!

@soopeach soopeach merged commit 2c7d079 into compose/develop Mar 6, 2024
1 check passed
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