diff --git a/DE/DE/Sources/Core/CommonUI/Cells/ReviewCollectionViewCell.swift b/DE/DE/Sources/Core/CommonUI/Cells/ReviewCollectionViewCell.swift index cb1d144a..c09e0ebf 100644 --- a/DE/DE/Sources/Core/CommonUI/Cells/ReviewCollectionViewCell.swift +++ b/DE/DE/Sources/Core/CommonUI/Cells/ReviewCollectionViewCell.swift @@ -17,10 +17,7 @@ public class ReviewCollectionViewCell: UICollectionViewCell { $0.font = UIFont.pretendard(.medium, size: 16) } - public lazy var score = UILabel().then { - $0.textColor = AppColor.purple100 - $0.font = UIFont.pretendard(.semiBold, size: 16) - } + public lazy var score = UILabel() public lazy var review = UILabel() @@ -91,9 +88,8 @@ public class ReviewCollectionViewCell: UICollectionViewCell { public func configure(model: WineReviewModel, isExpanded: Bool) { AppTextStyle.KR.body1.apply(to: nickname, text: model.name, color: AppColor.gray100) - - score.text = "★ \(String(model.rating))" - + AppTextStyle.KR.body2 + .apply(to: score, text: "★ \(String(model.rating))", color: AppColor.purple100) AppTextStyle.KR.body3.apply(to: review, text: model.contents, color: AppColor.gray90) if let data = model.createdAt.toFlexibleDotFormattedDate() { diff --git a/DE/DE/Sources/Core/CommonUI/View/CustomDropdownView.swift b/DE/DE/Sources/Core/CommonUI/View/CustomDropdownView.swift index 324e877e..23f8e5ba 100644 --- a/DE/DE/Sources/Core/CommonUI/View/CustomDropdownView.swift +++ b/DE/DE/Sources/Core/CommonUI/View/CustomDropdownView.swift @@ -64,18 +64,18 @@ public class CustomDropdownView: UIView { private func setupDropdownMenu() { dropdownMenu.backgroundColor = AppColor.white - dropdownMenu.layer.cornerRadius = 8 - dropdownMenu.layer.shadowColor = AppColor.black.cgColor + dropdownMenu.layer.cornerRadius = 6 + dropdownMenu.layer.shadowColor = UIColor(hex: "111111")?.cgColor dropdownMenu.layer.shadowOpacity = 0.1 - dropdownMenu.layer.shadowOffset = CGSize(width: 0, height: 2) - dropdownMenu.layer.shadowRadius = 8 + dropdownMenu.layer.shadowOffset = CGSize(width: 0, height: 1) + dropdownMenu.layer.shadowRadius = 10 dropdownMenu.isHidden = true dropdownMenu.alpha = 0.0 addSubview(dropdownMenu) dropdownMenu.snp.makeConstraints { $0.top.equalTo(dropdownButton.snp.bottom).offset(8) - $0.horizontalEdges.equalTo(dropdownButton).inset(5) + $0.trailing.equalTo(dropdownButton.snp.trailing).inset(16) $0.height.equalTo(35 * options.count) } @@ -83,7 +83,7 @@ public class CustomDropdownView: UIView { let optionLabel = UILabel() optionLabel.text = option optionLabel.textColor = AppColor.gray50 - optionLabel.font = UIFont.pretendard(.medium, size: 12) + optionLabel.font = UIFont.pretendard(.semiBold, size: 12) optionLabel.textAlignment = .left optionLabel.isUserInteractionEnabled = true optionLabel.tag = index @@ -94,7 +94,8 @@ public class CustomDropdownView: UIView { dropdownMenu.addSubview(optionLabel) optionLabel.snp.makeConstraints { - $0.centerX.equalToSuperview() + $0.leading.equalToSuperview().inset(12) + $0.trailing.equalToSuperview().inset(12) $0.height.equalTo(35) if index == 0 { $0.top.equalToSuperview() diff --git a/DE/DE/Sources/Core/CommonUI/View/EntireReviewView.swift b/DE/DE/Sources/Core/CommonUI/View/EntireReviewView.swift index cd0f2eaf..44c89f2f 100644 --- a/DE/DE/Sources/Core/CommonUI/View/EntireReviewView.swift +++ b/DE/DE/Sources/Core/CommonUI/View/EntireReviewView.swift @@ -21,7 +21,8 @@ public class EntireReviewView: UIView { $0.register(ReviewCollectionViewCell.self, forCellWithReuseIdentifier: ReviewCollectionViewCell.identifier) $0.backgroundColor = .clear $0.isScrollEnabled = true - $0.showsVerticalScrollIndicator = true + $0.showsVerticalScrollIndicator = false + $0.showsHorizontalScrollIndicator = false } public override init(frame: CGRect) { @@ -36,13 +37,13 @@ public class EntireReviewView: UIView { } private func addComponents() { - [title, dropdownView, reviewCollectionView].forEach{ self.addSubview($0) } + addSubviews(title, dropdownView, reviewCollectionView) } private func constraints() { title.snp.makeConstraints { $0.top.equalTo(safeAreaLayoutGuide) - $0.horizontalEdges.equalTo(safeAreaLayoutGuide) + $0.leading.equalToSuperview().inset(24) $0.height.equalTo(30) } @@ -53,7 +54,7 @@ public class EntireReviewView: UIView { } reviewCollectionView.snp.makeConstraints { - $0.top.equalTo(title.snp.bottom).offset(DynamicPadding.dynamicValue(20)) + $0.top.equalTo(title.snp.bottom).offset(16) $0.horizontalEdges.equalTo(safeAreaLayoutGuide).inset(24) $0.bottom.equalToSuperview() } diff --git a/DE/DE/Sources/Core/CommonUI/View/TitleWithBarView.swift b/DE/DE/Sources/Core/CommonUI/View/TitleWithBarView.swift index 2a5d0dde..505326cc 100644 --- a/DE/DE/Sources/Core/CommonUI/View/TitleWithBarView.swift +++ b/DE/DE/Sources/Core/CommonUI/View/TitleWithBarView.swift @@ -56,4 +56,12 @@ public class TitleWithBarView: UIView { make.bottom.equalToSuperview() } } + + public func setTitleColor(_ color: UIColor = AppColor.black) { + titleLabel.textColor = color + } + + public func setSubTitleColor(_ color: UIColor = AppColor.black) { + subTitleLabel.textColor = color + } } diff --git a/DE/DE/Sources/Core/CommonUI/View/TitleWithoutBarView.swift b/DE/DE/Sources/Core/CommonUI/View/TitleWithoutBarView.swift index 05cb0b72..65438c2b 100644 --- a/DE/DE/Sources/Core/CommonUI/View/TitleWithoutBarView.swift +++ b/DE/DE/Sources/Core/CommonUI/View/TitleWithoutBarView.swift @@ -38,4 +38,12 @@ public class TitleWithoutBarView: UIView { $0.centerY.equalToSuperview() } } + + public func setTitleColor(_ color: UIColor = AppColor.black) { + titleLabel.textColor = color + } + + public func setSubTitleColor(_ color: UIColor = AppColor.black) { + subTitleLabel.textColor = color + } } diff --git a/DE/DE/Sources/Features/Search/ViewControllers/EntireReviewViewController.swift b/DE/DE/Sources/Features/Search/ViewControllers/EntireReviewViewController.swift index 178417f4..0667edbb 100644 --- a/DE/DE/Sources/Features/Search/ViewControllers/EntireReviewViewController.swift +++ b/DE/DE/Sources/Features/Search/ViewControllers/EntireReviewViewController.swift @@ -11,8 +11,11 @@ class EntireReviewViewController: UIViewController, FirebaseTrackable { var screenName: String = Tracking.VC.entireReviewVC let navigationBarManager = NavigationBarManager() + var wineId: Int = 0 var wineName: String = "" + var vintage: Int? = nil + var reviewResults: [WineReviewModel] = [] let networkService = WineService() private let errorHandler = NetworkErrorHandler() @@ -28,38 +31,34 @@ class EntireReviewViewController: UIViewController, FirebaseTrackable { addView() constraints() - self.view.showColorBlockingView() - Task { - do { - try await callEntireReviewAPI(wineId: self.wineId, sortType: "최신순", page: 0) - self.view.hideBlockingView() - } catch { - self.view.hideBlockingView() - errorHandler.handleNetworkError(error, in: self) - } - } - setupDropdownAction() setupNavigationBar() } public override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - self.view.addSubview(indicator) self.navigationController?.setNavigationBarHidden(false, animated: animated) - } - - public override func viewWillDisappear(_ animated: Bool) { - super.viewWillDisappear(animated) - self.navigationController?.setNavigationBarHidden(true, animated: animated) + + view.addSubview(indicator) + view.showColorBlockingView() + setupDropdownAction() } public override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) logScreenView(fileName: #file) + + Task { + do { + try await callEntireReviewAPI(wineId: self.wineId, sortType: "최신순", page: 0) + self.view.hideBlockingView() + } catch { + self.view.hideBlockingView() + errorHandler.handleNetworkError(error, in: self) + } + } } private func setupNavigationBar() { - navigationBarManager.addBackButton( to: navigationItem, target: self, @@ -71,21 +70,7 @@ class EntireReviewViewController: UIViewController, FirebaseTrackable { navigationController?.popViewController(animated: true) } - private lazy var largeTitleLabel = UILabel().then { - let text = wineName - $0.numberOfLines = 0 - - let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineSpacing = 2 - - let attributes: [NSAttributedString.Key: Any] = [ - .font: UIFont.pretendard(.semiBold, size: 24), - .paragraphStyle: paragraphStyle, - .foregroundColor: AppColor.black - ] - - $0.attributedText = NSAttributedString(string: text, attributes: attributes) - } + private let largeTitleLabel = UILabel() private lazy var entireReviewView = EntireReviewView().then { $0.reviewCollectionView.delegate = self @@ -93,18 +78,27 @@ class EntireReviewViewController: UIViewController, FirebaseTrackable { } private func addView() { - [largeTitleLabel, entireReviewView].forEach{ view.addSubview($0) } + view.addSubviews(largeTitleLabel, entireReviewView) + + var displayText = wineName + if let vintage = vintage { + displayText += " \(vintage)" + } + largeTitleLabel.numberOfLines = 0 + largeTitleLabel.lineBreakMode = .byCharWrapping + + AppTextStyle.KR.body1.apply(to: largeTitleLabel, text: displayText, color: AppColor.gray70) } private func constraints() { largeTitleLabel.snp.makeConstraints { - $0.horizontalEdges.equalTo(view.safeAreaLayoutGuide).inset(25) - $0.top.equalTo(view.safeAreaLayoutGuide).offset(10) + $0.horizontalEdges.equalToSuperview().inset(24) + $0.top.equalTo(view.safeAreaLayoutGuide).offset(8) } entireReviewView.snp.makeConstraints { - $0.top.equalTo(largeTitleLabel.snp.bottom).offset(36) - $0.horizontalEdges.equalTo(view.safeAreaLayoutGuide) + $0.top.equalTo(largeTitleLabel.snp.bottom).offset(8) + $0.horizontalEdges.equalToSuperview() $0.bottom.equalTo(view.safeAreaLayoutGuide) } }