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

- 팔로잉 상태에서 알림 켜기/끄기 상태 추가
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,9 +12,7 @@ struct FollowCreatorItemView: View {
let creator: GetCreatorFollowingAllListItem
let onClickFollow: (Int) -> Void
let onClickUnFollow: (Int) -> Void
@State private var isFollow = true
let showCreatorFollowNotifyDialog: (Int) -> Void
var body: some View {
VStack(spacing: 13.3) {
@@ -26,29 +24,30 @@ struct FollowCreatorItemView: View {
Text(creator.nickname)
.font(.custom(Font.bold.rawValue, size: 16.7))
.foregroundColor(Color(hex: "eeeeee"))
.foregroundColor(Color.grayee)
.padding(.leading, 13.3)
Spacer()
Image(isFollow ? "btn_following_big" : "btn_follow_big")
.onTapGesture {
if isFollow {
onClickUnFollow(creator.creatorId)
} else {
onClickFollow(creator.creatorId)
}
isFollow = !isFollow
Image(
creator.isFollow ?
creator.isNotify ?
"btn_following_big" :
"btn_following_no_alarm_big" :
"btn_follow_big"
)
.onTapGesture {
if creator.isFollow {
showCreatorFollowNotifyDialog(creator.creatorId)
} else {
onClickFollow(creator.creatorId)
}
}
}
Rectangle()
.foregroundColor(Color(hex: "595959"))
.foregroundColor(Color.gray59)
.frame(height: 0.5)
}
.onAppear {
isFollow = creator.isFollow
}
}
}