콘텐츠 상세 - 크리에이터 팔로우와 알림설정

- 팔로잉 상태에서 알림 켜기/끄기 상태 추가
This commit is contained in:
Yu Sung
2024-09-23 16:39:18 +09:00
parent d3ab1507a4
commit ed4729ac11
4 changed files with 46 additions and 12 deletions

View File

@@ -12,7 +12,7 @@ struct ContentDetailCreatorProfileView: View {
let creator: AudioContentCreator
let onClickFollow: (Int) -> Void
let onClickUnFollow: (Int) -> Void
let showCreatorFollowNotifyDialog: (Int) -> Void
var body: some View {
HStack(spacing: 0) {
@@ -29,14 +29,19 @@ struct ContentDetailCreatorProfileView: View {
Spacer()
if creator.creatorId != UserDefaults.int(forKey: .userId) {
Image(creator.isFollowing ? "btn_following_big" : "btn_follow_big")
.onTapGesture {
if creator.isFollowing {
onClickUnFollow(creator.creatorId)
} else {
onClickFollow(creator.creatorId)
}
Image(creator.isFollow ?
creator.isNotify ?
"btn_following_big" :
"btn_following_no_alarm_big" :
"btn_follow_big"
)
.onTapGesture {
if creator.isFollowing {
showCreatorFollowNotifyDialog(creator.creatorId)
} else {
onClickFollow(creator.creatorId)
}
}
}
}
}