Skip to content

Commit

Permalink
[Feat] sopt-makers#327 - 친구가 아닌 경우의 버튼 분기처리
Browse files Browse the repository at this point in the history
  • Loading branch information
lsj8706 committed Dec 19, 2023
1 parent 6d35f1d commit f4461dc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public final class PokeKokButton: UIButton {
self.backgroundColor = backgroundColor
}

public func setIsFriend(with isFriend: Bool) {
self.isFriend = isFriend
}

private func setIcon() {
let icon = self.isFriend ? DSKitAsset.Assets.iconKok.image : DSKitAsset.Assets.iconEyes.image
self.setImage(icon.withTintColor(DSKitAsset.Colors.black.color), for: .normal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ extension PokeNotificationListContentView {
self.descriptionLabel.attributedText = model.description.applyMDSFont()
self.pokeChipView.configure(with: model.chipInfo)
self.pokeKokButton.isEnabled = !model.isPoked
self.pokeKokButton.setIsFriend(with: !model.isFirstMeet)
}

public func poked() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public struct NotificationListContentModel {
let description: String
let chipInfo: PokeChipView.ChipType
let isPoked: Bool
let isFirstMeet: Bool
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ extension PokeMainViewModel {
guard let self = self else { return }
print("모델: \(pokeUserModel)")
let notificationListContentModel = NotificationListContentModel(avatarUrl: pokeUserModel.profileImage,
pokeRelation: PokeRelation(rawValue: pokeUserModel.relationName)!,
pokeRelation: PokeRelation(rawValue: pokeUserModel.relationName) ?? .newFriend,
name: pokeUserModel.name,
partInfomation: pokeUserModel.part,
description: pokeUserModel.message,
chipInfo: self.makeChipInfo(with: pokeUserModel),
isPoked: pokeUserModel.isAlreadyPoke)
isPoked: pokeUserModel.isAlreadyPoke,
isFirstMeet: pokeUserModel.isFirstMeet)
output.pokedToMeUser.send(notificationListContentModel)
}.store(in: cancelBag)
}
Expand Down

0 comments on commit f4461dc

Please sign in to comment.