diff --git a/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift b/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift index 46e034bd..2108b66f 100644 --- a/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift +++ b/SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift @@ -94,13 +94,13 @@ public struct I18N { public struct ListDetail { public static let imagePlaceHolder = "달성 사진을 올려주세요" - public static let memoPlaceHolder = "메모를 작성해주세요" + public static let memoPlaceHolder = "함께한 사람과 어떤 추억을 남겼는지 작성해 주세요." public static let mission = "미션" public static let missionComplete = "미션 완료" public static let editComplete = "수정 완료" public static let editCompletedToast = "수정 완료되었습니다." public static let deleteTitle = "달성한 미션을 삭제하시겠습니까?" - public static let missionDatePlaceHolder = "날짜를 입력해주세요" + public static let missionDatePlaceHolder = "날짜를 입력해주세요." public static let datePickerDoneButtonTitle = "완료" public static let datePickerCancelButtonTitle = "취소" } diff --git a/SOPT-iOS/Projects/Features/StampFeature/Sources/Components/STChartRectangleView.swift b/SOPT-iOS/Projects/Features/StampFeature/Sources/Components/STChartRectangleView.swift index 5808a48c..6a84184f 100644 --- a/SOPT-iOS/Projects/Features/StampFeature/Sources/Components/STChartRectangleView.swift +++ b/SOPT-iOS/Projects/Features/StampFeature/Sources/Components/STChartRectangleView.swift @@ -176,6 +176,10 @@ extension STChartRectangleView { make.height.equalTo(32.f) make.centerY.equalToSuperview().inset(3) } + + rankLabel.snp.makeConstraints { make in + make.center.equalToSuperview() + } } else { self.addSubviews(rankLabel, rectangleView, usernameContainerView) @@ -188,8 +192,7 @@ extension STChartRectangleView { rectangleView.addSubview(scoreLabel) scoreLabel.snp.makeConstraints { make in - make.top.equalToSuperview().inset(8.adjusted) - make.centerX.equalToSuperview() + make.center.equalToSuperview() } rectangleView.snp.makeConstraints { make in diff --git a/SOPT-iOS/Projects/Features/StampFeature/Sources/ListDetailScene/VC/ListDetailVC.swift b/SOPT-iOS/Projects/Features/StampFeature/Sources/ListDetailScene/VC/ListDetailVC.swift index 8e0d2733..d8293ec1 100644 --- a/SOPT-iOS/Projects/Features/StampFeature/Sources/ListDetailScene/VC/ListDetailVC.swift +++ b/SOPT-iOS/Projects/Features/StampFeature/Sources/ListDetailScene/VC/ListDetailVC.swift @@ -114,7 +114,6 @@ public class ListDetailVC: UIViewController, ListDetailViewControllable { private let imagePlaceholderLabel = UILabel() private let textView = UITextView() private lazy var missionDateTextField = MissionDateView(frame: self.view.frame) - private let dateLabel = UILabel() private lazy var bottomButton = STCustomButton(title: sceneType == .none ? I18N.ListDetail.missionComplete : I18N.ListDetail.editComplete) .setEnabled(false) .setColor(bgColor: starLevel.pointColor, @@ -235,7 +234,6 @@ extension ListDetailVC { self.missionDateTextField.setIsEnabled(false) self.missionDateTextField.setTextFieldView(.inactive) self.textView.text = model.content - self.dateLabel.text = model.date } private func reloadData(_ scenetype: ListDetailSceneType) { @@ -268,6 +266,16 @@ extension ListDetailVC { name: UIResponder.keyboardWillHideNotification, object: nil ) + + self.missionDateTextField + .signalForChangeDate() + .dropFirst() + .removeDuplicates() + .sink(receiveValue: { [weak self] date in + guard let self else { return } + + self.bottomButton.setEnabled(!date.isEmpty && self.textView.hasText) + }).store(in: self.cancelBag) } private func setGesture() { @@ -476,7 +484,6 @@ extension ListDetailVC { self.imagePlaceholderLabel.isHidden = missionImageView.image == nil ? false : true self.missionImageView.isUserInteractionEnabled = true self.bottomButton.isHidden = false - self.dateLabel.isHidden = true case .completed: self.scrollView.isScrollEnabled = false self.scrollView.setContentOffset(.zero, animated: true) @@ -485,7 +492,6 @@ extension ListDetailVC { self.setTextView(.completed) self.imagePlaceholderLabel.isHidden = true self.bottomButton.isHidden = true - self.dateLabel.isHidden = false self.missionImageView.isUserInteractionEnabled = false self.missionDateTextField.setTextFieldView(.completed) } @@ -516,11 +522,8 @@ extension ListDetailVC { self.textView.textContainerInset = UIEdgeInsets(top: 14, left: 14, bottom: 14, right: 14) self.imagePlaceholderLabel.textColor = DSKitAsset.Colors.soptampGray500.color - self.dateLabel.textColor = DSKitAsset.Colors.soptampGray600.color - self.imagePlaceholderLabel.setTypoStyle(.SoptampFont.subtitle2) self.textView.setTypoStyle(.SoptampFont.caption1) - self.dateLabel.setTypoStyle(.SoptampFont.number3) self.imagePlaceholderLabel.text = I18N.ListDetail.imagePlaceHolder self.textView.text = I18N.ListDetail.memoPlaceHolder @@ -608,17 +611,12 @@ extension ListDetailVC { make.width.equalToSuperview() } - self.contentView.addSubviews(contentStackView, dateLabel, bottomButton) + contentView.addSubviews(contentStackView, bottomButton) contentStackView.snp.makeConstraints { make in make.leading.top.trailing.equalToSuperview() } - dateLabel.snp.makeConstraints { make in - make.trailing.equalToSuperview() - make.top.equalTo(contentStackView.snp.bottom).offset(12) - } - bottomButton.snp.makeConstraints { make in make.leading.trailing.bottom.equalToSuperview() make.top.equalTo(contentStackView.snp.bottom).offset(UIDevice.current.hasNotch ? 30 : 20) diff --git a/SOPT-iOS/Projects/Features/StampFeature/Sources/ListDetailScene/View/MissionDateView.swift b/SOPT-iOS/Projects/Features/StampFeature/Sources/ListDetailScene/View/MissionDateView.swift index a753d8e5..38776597 100644 --- a/SOPT-iOS/Projects/Features/StampFeature/Sources/ListDetailScene/View/MissionDateView.swift +++ b/SOPT-iOS/Projects/Features/StampFeature/Sources/ListDetailScene/View/MissionDateView.swift @@ -112,7 +112,13 @@ extension MissionDateView { self.layer.borderWidth = .zero } } - + + public func signalForChangeDate() -> Driver { + self.textField + .publisher(for: .allEditingEvents) + .compactMap { $0.text } + .asDriver() + } } // MARK: - Private Extensions @@ -150,6 +156,7 @@ extension MissionDateView { $0.datePickerMode = .date $0.locale = Locale(identifier: "ko-kr") $0.preferredDatePickerStyle = .wheels + $0.maximumDate = Date() } datePicker diff --git a/SOPT-iOS/Projects/Features/StampFeature/Sources/RankingScene/VC/RankingVC.swift b/SOPT-iOS/Projects/Features/StampFeature/Sources/RankingScene/VC/RankingVC.swift index 17a92d67..7b7e4fe4 100644 --- a/SOPT-iOS/Projects/Features/StampFeature/Sources/RankingScene/VC/RankingVC.swift +++ b/SOPT-iOS/Projects/Features/StampFeature/Sources/RankingScene/VC/RankingVC.swift @@ -63,6 +63,7 @@ public class RankingVC: UIViewController, RankingViewControllable { attributedStr.addAttribute(NSAttributedString.Key.kern, value: 0, range: NSMakeRange(0, attributedStr.length)) attributedStr.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.white, range: NSMakeRange(0, attributedStr.length)) bt.setAttributedTitle(attributedStr, for: .normal) + bt.isHidden = true return bt }() @@ -162,6 +163,17 @@ extension RankingVC { ) let output = self.viewModel.transform(from: input, cancelBag: self.cancelBag) + + output.$rankingListModel + .sink { [weak self] model in + guard + let self, + let name = UserDefaultKeyList.User.soptampName, + model.contains(where: { $0.username == name }) + else { return } + + self.showMyRankingFloatingButton.isHidden = false + }.store(in: self.cancelBag) output.$rankingListModel .dropFirst(2)