Skip to content

Commit

Permalink
[Feat/#30] 디테일 수정 및 불필요한 코드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
oyslucy committed Feb 3, 2025
1 parent 9e7e2f4 commit d6240f1
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ final class ConfirmedCVC: UICollectionViewCell, View {
}

scheduleTitleLabel.do {
$0.font = .PretendardStyle.b4_sb.font
$0.font = .PretendardStyle.b1_sb.font
$0.textColor = .appGray900
}

timeLabel.do {
$0.font = .PretendardStyle.b5_r.font
$0.textColor = .appGray800
$0.font = .PretendardStyle.c3_r.font
$0.textColor = .appGray700
}

divider.do {
Expand All @@ -65,23 +65,23 @@ final class ConfirmedCVC: UICollectionViewCell, View {
// MARK: setUpLayout
private func setUpLayout() {
chip.snp.makeConstraints {
$0.top.equalToSuperview().offset(20)
$0.top.equalToSuperview().offset(15)
$0.leading.equalToSuperview().offset(6)
$0.size.equalTo(13)
}

scheduleTitleLabel.snp.makeConstraints {
$0.top.equalToSuperview().offset(15)
$0.top.equalToSuperview().offset(10)
$0.leading.equalTo(chip.snp.trailing).offset(9)
}

timeLabel.snp.makeConstraints {
$0.top.equalTo(scheduleTitleLabel.snp.bottom).offset(1)
$0.top.equalTo(scheduleTitleLabel.snp.bottom).offset(4)
$0.leading.equalTo(scheduleTitleLabel)
}

divider.snp.makeConstraints {
$0.top.equalTo(timeLabel.snp.bottom).offset(15)
$0.bottom.equalToSuperview()
$0.horizontalEdges.equalToSuperview()
$0.height.equalTo(1)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ final class InProgressCVC: UICollectionViewCell, View {
}

moveButton.snp.makeConstraints {
$0.top.trailing.equalToSuperview().inset(22)
$0.centerY.equalTo(scheduleTitleLabel)
$0.trailing.equalToSuperview().inset(22)
$0.size.equalTo(18)
}

timeLabel.snp.makeConstraints {
$0.top.equalTo(scheduleTitleLabel.snp.bottom).offset(10)
$0.top.equalTo(scheduleTitleLabel.snp.bottom).offset(13)
$0.leading.equalTo(scheduleTitleLabel)
}

Expand Down Expand Up @@ -129,7 +130,7 @@ extension InProgressCVC {
let schedule = reactor.currentState.schedule
scheduleTitleLabel.text = schedule.schedule.name
timeLabel.text = NSTDateUtility.durationList(schedule.startTime, schedule.endTime)
availabilityLabel.text = "\(schedule.availableMemberCount) / \(schedule.groupMemberCount)"
availabilityLabel.text = "\(schedule.availableMemberCount)/ \(schedule.groupMemberCount)"
progressBar.snp.makeConstraints {
$0.top.equalTo(timeLabel.snp.bottom).offset(10)
$0.leading.equalTo(backgroundProgressBar)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ final class GroupDetailView: UIView {

// MARK: Init
override init(frame: CGRect) {
let layout = UICollectionViewFlowLayout()
self.inProgressCollectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
self.confirmedCollectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
let inProgressLayout = UICollectionViewFlowLayout()
let confirmedLayout = UICollectionViewFlowLayout()
self.inProgressCollectionView = UICollectionView(frame: .zero, collectionViewLayout: inProgressLayout)
self.confirmedCollectionView = UICollectionView(frame: .zero, collectionViewLayout: confirmedLayout)
super.init(frame: frame)
setUpFoundation()
setUpHierarchy()
Expand All @@ -50,7 +51,7 @@ final class GroupDetailView: UIView {
private func setUpHierarchy() {
[profileImageView, groupNameLabel, shareButton, groupMemberButton, scheduleListLabel,
segmentedControl, underlineView, selectedUnderlineView,
defaultLabel, inProgressCollectionView, confirmedCollectionView].forEach {
inProgressCollectionView, confirmedCollectionView, defaultLabel].forEach {
self.addSubview($0)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,6 @@ final class GroupDetailReactor: Reactor {
return Observable.just(.setConfirmedData(reactors))
}
}

// func mutate(action: Action) -> Observable<Mutation> {
// switch action {
// case .selectSegment(let index):
// return Observable.just(.setSelectedSegment(index))
//
// case .loadInProgressData:
// return Observable.just(.setInProgressData(mockInProgressData.map { InProgressCellReactor(schedule: $0) }))
// .observe(on: MainScheduler.instance)
//
// case .loadConfirmedData:
// return Observable.just(.setConfirmedData(mockConfirmedData.map { ConfirmedCellReactor(schedule: $0) }))
// .observe(on: MainScheduler.instance)
// }
// }

func reduce(state: State, mutation: Mutation) -> State {
var newState = state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,9 @@ final class GroupDetailViewController: UIViewController, View {
self.rootView.inProgressCollectionView.isHidden = !isProgress
self.rootView.confirmedCollectionView.isHidden = isProgress

let inProgressEmpty = state.inProgressCellReactors.isEmpty
let confirmedEmpty = state.confirmedCellReactors.isEmpty

self.rootView.defaultLabel.isHidden = !(isProgress ? inProgressEmpty : confirmedEmpty)
let noData = isProgress ? state.inProgressCellReactors.isEmpty : state.confirmedCellReactors.isEmpty
self.rootView.defaultLabel.text = isProgress ? "현재 진행중인 약속이 없어요" : "아직 확정된 약속이 없어요"
self.rootView.layoutIfNeeded()
self.rootView.defaultLabel.isHidden = !noData
})
.disposed(by: disposeBag)

Expand All @@ -109,7 +106,6 @@ final class GroupDetailViewController: UIViewController, View {
}

extension GroupDetailViewController: UICollectionViewDelegateFlowLayout {
/// 순서가 왜바껴쓸까..
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
switch collectionView {
case rootView.inProgressCollectionView:
Expand Down

0 comments on commit d6240f1

Please sign in to comment.