diff --git a/MLS/MLSDesignSystem/Sources/MLSDesignSystem/Components/CardList.swift b/MLS/MLSDesignSystem/Sources/MLSDesignSystem/Components/CardList.swift index 9d1dbfe0..73c3199e 100644 --- a/MLS/MLSDesignSystem/Sources/MLSDesignSystem/Components/CardList.swift +++ b/MLS/MLSDesignSystem/Sources/MLSDesignSystem/Components/CardList.swift @@ -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 } @@ -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 @@ -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 diff --git a/MLS/MLSDesignSystem/Sources/MLSDesignSystem/Components/Tooltip/TooltipView.swift b/MLS/MLSDesignSystem/Sources/MLSDesignSystem/Components/Tooltip/TooltipView.swift index 89c244eb..1b1ff343 100644 --- a/MLS/MLSDesignSystem/Sources/MLSDesignSystem/Components/Tooltip/TooltipView.swift +++ b/MLS/MLSDesignSystem/Sources/MLSDesignSystem/Components/Tooltip/TooltipView.swift @@ -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 } } diff --git a/MLS/MLSRecommendationFeature/Sources/MLSRecommendationFeature/Presentation/RecommendationMain/RecommendationMainViewController.swift b/MLS/MLSRecommendationFeature/Sources/MLSRecommendationFeature/Presentation/RecommendationMain/RecommendationMainViewController.swift index b9a41fa8..421c6cc5 100644 --- a/MLS/MLSRecommendationFeature/Sources/MLSRecommendationFeature/Presentation/RecommendationMain/RecommendationMainViewController.swift +++ b/MLS/MLSRecommendationFeature/Sources/MLSRecommendationFeature/Presentation/RecommendationMain/RecommendationMainViewController.swift @@ -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 } @@ -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) } } diff --git a/MLS/MLSRecommendationFeature/Sources/MLSRecommendationFeature/Presentation/RecommendationMain/Views/RecommendationMainView.swift b/MLS/MLSRecommendationFeature/Sources/MLSRecommendationFeature/Presentation/RecommendationMain/Views/RecommendationMainView.swift index c1649ab7..34ea39c9 100644 --- a/MLS/MLSRecommendationFeature/Sources/MLSRecommendationFeature/Presentation/RecommendationMain/Views/RecommendationMainView.swift +++ b/MLS/MLSRecommendationFeature/Sources/MLSRecommendationFeature/Presentation/RecommendationMain/Views/RecommendationMainView.swift @@ -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 @@ -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 @@ -88,6 +96,7 @@ private extension RecommendationMainView { informationButton.addSubview(informationIconView) grayBackgroundView.addSubview(collectionView) addSubview(emptyView) + addSubview(emptyDataLabel) } func setupConstraints() { @@ -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() + } } } @@ -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 } }