diff --git a/KkuMulKum/Source/MeetingInfo/Cell/MeetingMemberCell.swift b/KkuMulKum/Source/MeetingInfo/Cell/MeetingMemberCell.swift index 0f9c31b5..3974ae46 100644 --- a/KkuMulKum/Source/MeetingInfo/Cell/MeetingMemberCell.swift +++ b/KkuMulKum/Source/MeetingInfo/Cell/MeetingMemberCell.swift @@ -33,6 +33,9 @@ final class MeetingMemberCell: BaseCollectionViewCell { super.prepareForReuse() profileImageButton.do { + var config = UIButton.Configuration.plain() + config.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0) + $0.imageView?.image = nil $0.backgroundColor = .clear $0.isEnabled = false @@ -89,6 +92,10 @@ private extension MeetingMemberCell { self.delegate = delegate profileImageButton.do { + var config = UIButton.Configuration.plain() + config.contentInsets = NSDirectionalEdgeInsets(top: 5, leading: 0, bottom: 0, trailing: 0) + + $0.configuration = config $0.backgroundColor = .gray1 $0.setImage(.iconPlus.withTintColor(.gray4), for: .normal) $0.isEnabled = true diff --git a/KkuMulKum/Source/MeetingInfo/View/MeetingInfoBannerView.swift b/KkuMulKum/Source/MeetingInfo/View/MeetingInfoBannerView.swift index 529c2b7f..0a90792b 100644 --- a/KkuMulKum/Source/MeetingInfo/View/MeetingInfoBannerView.swift +++ b/KkuMulKum/Source/MeetingInfo/View/MeetingInfoBannerView.swift @@ -15,7 +15,9 @@ final class MeetingInfoBannerView: BaseView { $0.setText("모임 생성일", style: .label01, color: .gray4) } - private let divider = UIView(backgroundColor: .gray4) + private let divider = UILabel().then { + $0.setText("l", style: .label01, color: .gray4) + } private let createdAtLabel = UILabel().then { $0.setText("2024.06.01", style: .label01, color: .gray4) @@ -40,24 +42,29 @@ final class MeetingInfoBannerView: BaseView { backgroundColor = .lightGreen layer.cornerRadius = 8 - horizontalStackView.addArrangedSubviews(explanationLabel, divider, createdAtLabel) - backgroundImageView.addSubviews(horizontalStackView, metCountLabel) + backgroundImageView.addSubviews(explanationLabel, divider, createdAtLabel, metCountLabel) addSubviews(backgroundImageView) } override func setupAutoLayout() { + explanationLabel.snp.makeConstraints { + $0.top.equalToSuperview().offset(20) + $0.leading.equalToSuperview().offset(16) + } + divider.snp.makeConstraints { - $0.width.equalTo(1) + $0.leading.equalTo(explanationLabel.snp.trailing).offset(12) + $0.centerY.equalTo(explanationLabel) } - horizontalStackView.snp.makeConstraints { - $0.top.equalToSuperview().offset(20) - $0.leading.equalToSuperview().offset(16) + createdAtLabel.snp.makeConstraints { + $0.leading.equalTo(divider.snp.trailing).offset(12) + $0.centerY.equalTo(explanationLabel) } metCountLabel.snp.makeConstraints { - $0.top.equalTo(horizontalStackView.snp.bottom).offset(2) - $0.leading.equalTo(horizontalStackView) + $0.top.equalTo(explanationLabel.snp.bottom).offset(2) + $0.leading.equalTo(explanationLabel) $0.bottom.equalToSuperview().offset(-20) } diff --git a/KkuMulKum/Source/MeetingInfo/View/MeetingInfoView.swift b/KkuMulKum/Source/MeetingInfo/View/MeetingInfoView.swift index e5bf2150..e802e016 100644 --- a/KkuMulKum/Source/MeetingInfo/View/MeetingInfoView.swift +++ b/KkuMulKum/Source/MeetingInfo/View/MeetingInfoView.swift @@ -57,12 +57,6 @@ final class MeetingInfoView: BaseView { $0.setText("모임 참여 인원 0명", style: .body01, color: .gray8) } - private let arrowButton = UIButton().then { - let image = UIImage(resource: .iconRight).withTintColor(.gray4) - $0.setImage(image, for: .normal) - $0.contentMode = .scaleAspectFill - } - private let createPromiseButton = UIButton(backgroundColor: .maincolor).then { $0.setTitle("+ 약속추가", style: .body01, color: .white) $0.layer.cornerRadius = Screen.height(52) / 2 @@ -102,7 +96,7 @@ final class MeetingInfoView: BaseView { ) emptyDescriptionView.addSubviews(emptyDescriptionLabel) addSubviews( - infoBanner, memberCountLabel, arrowButton, memberListView, createPromiseButton, + infoBanner, memberCountLabel, memberListView, createPromiseButton, grayBackgroundView ) bringSubviewToFront(createPromiseButton) @@ -121,11 +115,6 @@ final class MeetingInfoView: BaseView { $0.leading.equalTo(infoBanner) } - arrowButton.snp.makeConstraints { - $0.trailing.equalToSuperview().offset(-20) - $0.centerY.equalTo(memberCountLabel) - } - memberListView.snp.makeConstraints { $0.top.equalTo(memberCountLabel.snp.bottom).offset(20) $0.horizontalEdges.equalToSuperview() diff --git a/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift b/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift index ad170385..f5ac6d14 100644 --- a/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift +++ b/KkuMulKum/Source/MeetingInfo/ViewModel/MeetingInfoViewModel.swift @@ -57,7 +57,33 @@ extension MeetingInfoViewModel: ViewModelType { } .disposed(by: disposeBag) - let info = infoRelay.asDriver(onErrorJustReturn: nil) + let info = infoRelay + .map { info -> MeetingInfoModel? in + guard let info else { + print("MeetingInfoModel이 존재하지 않습니다.") + return nil + } + + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" + + guard let date = dateFormatter.date(from: info.createdAt) else { + print("서버의 date가 형식에 맞지 않습니다.") + return nil + } + + dateFormatter.dateFormat = "yyyy.MM.dd" + let dateString = dateFormatter.string(from: date) + + return MeetingInfoModel( + meetingID: info.meetingID, + name: info.name, + createdAt: dateString, + metCount: info.metCount, + invitationCode: info.invitationCode + ) + } + .asDriver(onErrorJustReturn: nil) let memberCount = meetingMemberModelRelay .compactMap { $0?.memberCount } @@ -218,7 +244,7 @@ private extension MeetingInfoViewModel { if 0 < dDay { return ("+\(dDay)", .past) } else if 0 == dDay { - return ("-Day", .today) + return ("-DAY", .today) } else { return ("\(dDay)", .future) }