Skip to content

Commit

Permalink
[Fix] 솝탬프 QA 반영 (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
elesahich authored Apr 18, 2024
1 parent 895ae24 commit 669876a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 18 deletions.
4 changes: 2 additions & 2 deletions SOPT-iOS/Projects/Core/Sources/Literals/StringLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "취소"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
Expand All @@ -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)
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ extension MissionDateView {
self.layer.borderWidth = .zero
}
}


public func signalForChangeDate() -> Driver<String> {
self.textField
.publisher(for: .allEditingEvents)
.compactMap { $0.text }
.asDriver()
}
}

// MARK: - Private Extensions
Expand Down Expand Up @@ -150,6 +156,7 @@ extension MissionDateView {
$0.datePickerMode = .date
$0.locale = Locale(identifier: "ko-kr")
$0.preferredDatePickerStyle = .wheels
$0.maximumDate = Date()
}

datePicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}()

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 669876a

Please sign in to comment.