Skip to content

Commit

Permalink
[Feat] sopt-makers#325 - 단짝 친구, 천생 연분 섹션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
lsj8706 committed Dec 17, 2023
1 parent 859bc93 commit fe03008
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,20 @@ public final class PokeMyFriendsVC: UIViewController, PokeMyFriendsViewControlla
}

private let contentStackView = UIStackView().then {
$0.backgroundColor = DSKitAsset.Colors.gray900.color
$0.axis = .vertical
$0.spacing = 8
}

private let newFriendsSectionView = PokeFriendsSectionGroupView(pokeRelation: .newFriend, maxContentsCount: 2)
.fillHeader(title: I18N.Poke.MyFriends.newFriends, description: I18N.Poke.MyFriends.friendsBaseline(2))

private let bestFriendsSectionView = PokeFriendsSectionGroupView(pokeRelation: .bestFriend, maxContentsCount: 2)
.fillHeader(title: I18N.Poke.MyFriends.bestFriend, description: I18N.Poke.MyFriends.friendsBaseline(5))

private let soulmateSectionView = PokeFriendsSectionGroupView(pokeRelation: .soulmate, maxContentsCount: 2)
.fillHeader(title: I18N.Poke.MyFriends.soulmate, description: I18N.Poke.MyFriends.friendsBaseline(11))

// MARK: - initialization

public init(viewModel: PokeMyFriendsViewModel) {
Expand Down Expand Up @@ -73,7 +80,7 @@ extension PokeMyFriendsVC {
}

private func setStackView() {
self.contentStackView.addArrangedSubviews(newFriendsSectionView)
self.contentStackView.addArrangedSubviews(newFriendsSectionView, bestFriendsSectionView, soulmateSectionView)
}

private func setLayout() {
Expand Down Expand Up @@ -109,5 +116,9 @@ extension PokeMyFriendsVC {
private func bindViewModel() {

self.newFriendsSectionView.setData(friendsCount: 84, models: [.init(userId: "", avatarUrl: "", name: "가나다", partInfomation: "33기 안드로이드", pokeCount: 4, relation: .newFriend), .init(userId: "", avatarUrl: "", name: "가나다", partInfomation: "33기 안드로이드", pokeCount: 4, relation: .newFriend)])

self.bestFriendsSectionView.setData(friendsCount: 100, models: [.init(userId: "", avatarUrl: "", name: "가나다", partInfomation: "33기 안드로이드", pokeCount: 4, relation: .newFriend), .init(userId: "", avatarUrl: "", name: "가나다", partInfomation: "33기 서버", pokeCount: 4, relation: .newFriend)])

self.soulmateSectionView.setData(friendsCount: 2, models: [])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public final class PokeFriendsSectionGroupView: UIView {

extension PokeFriendsSectionGroupView {
private func setUI() {
self.backgroundColor = .clear
self.backgroundColor = DSKitAsset.Colors.gray950.color
}

private func makeContents() {
guard self.maxContentsCount > 0 else { return }
for _ in 0..<self.maxContentsCount {
let profileListView = PokeProfileListView(viewType: .default).setDividerViewIsHidden(to: false)
for i in 0..<self.maxContentsCount {
let profileListView = PokeProfileListView(viewType: .default).setDividerViewIsHidden(to: i == maxContentsCount-1)
profileListView.isHidden = true
profileListView.kokButtonTap.sink { [weak self] userId in
self?.kokButtonTap.send(userId)
Expand Down

0 comments on commit fe03008

Please sign in to comment.