팔로잉/팔로워 리스트 - 팔로우와 알림설정

- 팔로잉 상태에서 알림 켜기/끄기 상태 추가
This commit is contained in:
Yu Sung
2024-09-23 17:54:35 +09:00
parent 31696ce7da
commit 6c8f3eb8bb
8 changed files with 167 additions and 100 deletions

View File

@@ -12,7 +12,7 @@ struct FollowerListItemView: View {
let item: GetFollowerListResponseItem
let creatorFollow: (Int) -> Void
let creatorUnFollow: (Int) -> Void
let showCreatorFollowNotifyDialog: (Int) -> Void
var body: some View {
VStack(spacing: 13.3) {
@@ -29,13 +29,18 @@ struct FollowerListItemView: View {
Spacer()
if let isFollow = item.isFollow {
Image(isFollow ? "btn_following_big" : "btn_follow_big")
.onTapGesture {
isFollow ?
creatorUnFollow(item.userId) :
creatorFollow(item.userId)
}
if let isFollow = item.isFollow, let isNotify = item.isNotify {
Image(isFollow ?
isNotify ?
"btn_following_big" :
"btn_following_no_alarm_big" :
"btn_follow_big"
)
.onTapGesture {
isFollow ?
showCreatorFollowNotifyDialog(item.userId) :
creatorFollow(item.userId)
}
}
}
.padding(.top, 13.3)
@@ -59,7 +64,7 @@ struct FollowerListItemView_Previews: PreviewProvider {
isFollow: false
),
creatorFollow: { _ in },
creatorUnFollow: { _ in }
showCreatorFollowNotifyDialog: { _ in }
)
}
}