Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public final class CardList: UIView {
static let iconSize: CGFloat = 24
static let mapImageSize: CGFloat = 40
static let tagHeight: CGFloat = 24
static let tagWidth: CGFloat = 45
static let tagHorizontalInset: CGFloat = 10
static let tagVerticalInset: CGFloat = 4
}
Expand Down Expand Up @@ -141,6 +142,7 @@ public final class CardList: UIView {

private let rankTag = {
let label = UILabel()
label.textAlignment = .center
label.font = .korFont(style: .semiBold, size: 14)
label.textColor = .primary700
return label
Expand Down Expand Up @@ -195,6 +197,7 @@ private extension CardList {

rankContainer.snp.makeConstraints { make in
make.height.equalTo(Constant.tagHeight)
make.width.equalTo(Constant.tagWidth)
}

rankTag.snp.makeConstraints { make in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,11 @@ extension TooltipView {
shapeLayer.frame = bounds
shapeLayer.path = bubblePath.cgPath
shapeLayer.fillColor = UIColor.whiteMLS.cgColor

shapeLayer.shadowPath = bubblePath.cgPath
shapeLayer.shadowColor = UIColor.black.withAlphaComponent(0.15).cgColor
shapeLayer.shadowOpacity = 1
shapeLayer.shadowRadius = 20
shapeLayer.shadowOffset = .zero
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,17 @@ extension RecommendationMainViewController {
}
.disposed(by: disposeBag)

reactor.state
.observe(on: MainScheduler.instance)
.map { $0.recommendations }
.distinctUntilChanged { $0.map { ($0.mapId, $0.bookmarkId) }.elementsEqual($1.map { ($0.mapId, $0.bookmarkId) }) { $0 == $1 } }
.withUnretained(self)
.subscribe { owner, mapData in
owner.mainView.collectionView.reloadData()
owner.mainView.checkEmptyData(isEmpty: mapData.isEmpty)
}
.disposed(by: disposeBag)

reactor.state
.observe(on: MainScheduler.instance)
.map { $0.isLogin }
Expand All @@ -198,16 +209,6 @@ extension RecommendationMainViewController {
(owner.tabBarController as? BottomTabBarController)?.checkRecommendationFirstLaunch(isFirst: true)
}
.disposed(by: disposeBag)

reactor.state
.observe(on: MainScheduler.instance)
.map { $0.recommendations }
.distinctUntilChanged { $0.map { ($0.mapId, $0.bookmarkId) }.elementsEqual($1.map { ($0.mapId, $0.bookmarkId) }) { $0 == $1 } }
.withUnretained(self)
.subscribe { owner, _ in
owner.mainView.collectionView.reloadData()
}
.disposed(by: disposeBag)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ internal final class RecommendationMainView: UIView {
static let cellHeight: CGFloat = 104
static let cellSpacing: CGFloat = 8
static let bottomTabHeight: CGFloat = 64
static let emptyLabelTopOffset: CGFloat = 16
}

// MARK: - Properties
Expand Down Expand Up @@ -61,6 +62,13 @@ internal final class RecommendationMainView: UIView {
return view
}()

private let emptyDataLabel: UILabel = {
let label = UILabel()
label.attributedText = .makeStyledString(font: .b_s_r, text: "추천 정보가 존재하지 않습니다.", color: .neutral600, alignment: .center)
label.isHidden = true
return label
}()

internal let emptyView = ToLoginView(type: .recommend)

// MARK: - init
Expand Down Expand Up @@ -88,6 +96,7 @@ private extension RecommendationMainView {
informationButton.addSubview(informationIconView)
grayBackgroundView.addSubview(collectionView)
addSubview(emptyView)
addSubview(emptyDataLabel)
}

func setupConstraints() {
Expand Down Expand Up @@ -133,6 +142,11 @@ private extension RecommendationMainView {
make.bottom.equalToSuperview().inset(Constant.bottomTabHeight)
}
emptyView.isHidden = true

emptyDataLabel.snp.makeConstraints { make in
make.top.equalTo(informationButton.snp.bottom).offset(Constant.emptyLabelTopOffset)
make.centerX.equalToSuperview()
}
}
}

Expand All @@ -142,5 +156,11 @@ extension RecommendationMainView {
profileView.isHidden = !isLogin
grayBackgroundView.isHidden = !isLogin
emptyView.isHidden = isLogin
emptyDataLabel.isHidden = !isLogin
}

func checkEmptyData(isEmpty: Bool) {
collectionView.isHidden = isEmpty
emptyDataLabel.isHidden = !isEmpty
}
}
Loading