Skip to content

[#198] 리뷰v2 UI 작업 #246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 39 commits into
base: develop-3.0.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
68cb0f8
[#198] MenuChipHorizontalScrollView 구현
CJiu01 Feb 1, 2025
6350b07
[#198] ReviewList 구성 완료
CJiu01 Feb 2, 2025
866bcb4
[#198] ReviewView 전체 스크롤 추가 및 reviewCell 동적 크기 적용
CJiu01 Feb 2, 2025
3624101
[#198] reviewTextView -> label로 변경
CJiu01 Feb 2, 2025
2635bd6
[#198] scrollView와 writingReviewButton 사이 offset 추가
CJiu01 Feb 2, 2025
0e35413
[#198] photoUpload asset 추가
CJiu01 Feb 2, 2025
589b1ed
[#198] modal 스타일 .pageSheet 적용
CJiu01 Feb 2, 2025
2631b67
[#198] 메뉴 thumbup/down 항목 제외한 UI 완료
CJiu01 Feb 2, 2025
c005daf
[#198] 리뷰v2 파일 생성 및 사용하지 않는 파일 제거
CJiu01 Feb 11, 2025
58819a9
[#198] ReportVC FIX주석 추가
CJiu01 Feb 11, 2025
4e9d3cd
[#198] 리뷰작성모달 제작
CJiu01 Feb 11, 2025
6841ddc
[#198] chip spacing 계산을 위한 임시 데이터 삽입
CJiu01 Feb 11, 2025
79bb96e
[#198] ReactionView 제작
CJiu01 Feb 11, 2025
e7ba4ab
[#198] MenuChip 스크롤뷰 제작
CJiu01 Feb 11, 2025
5d655b1
[#198] 리뷰테이블 cell 제작
CJiu01 Feb 11, 2025
7ad7b0d
[#198] 모달 완료하기 버튼 수정
CJiu01 Feb 11, 2025
38fecab
[#198] feedback image 추가
CJiu01 Feb 18, 2025
2a1984f
[#198] GoogleAds 관련 코드 주석 처리
CJiu01 Feb 18, 2025
026796d
[#198] HomeVC GoogleAds 관련 코드 주석 처리
CJiu01 Feb 18, 2025
d5127ee
[#198] image 네이밍 수정
CJiu01 Feb 18, 2025
6411025
[#198] MenuFeedbackView UI 및 토글 이벤트 구현
CJiu01 Feb 18, 2025
ea53cb6
[#198] ChartComponentView 구현
CJiu01 Feb 19, 2025
0a75f11
[#198] final 키워드 추가
CJiu01 Feb 19, 2025
aac34e6
[#198] RateNumberView -> StarRatingView 네이밍 변경
CJiu01 Feb 19, 2025
462edec
[#198] StarRatingView 리팩토링
CJiu01 Feb 19, 2025
5cab3e1
[#198] ThumbsCountView 컴포넌트화
CJiu01 Feb 19, 2025
4905574
[#198] 네이밍 변경사항 적용
CJiu01 Feb 19, 2025
9f66ce2
[#198] 기존 RateNumberView 복구
CJiu01 Feb 19, 2025
88d445c
[#198] 메뉴명 길이에 따른 summaryView 높이 유동적으로 변경하도록 수정
CJiu01 Feb 19, 2025
2fd8bb9
[#198] SummaryView 컴포넌트 배치 완료
CJiu01 Feb 19, 2025
ba3156b
[#198] ReviewSummaryView 레이아웃 적용 완료
CJiu01 Feb 19, 2025
aa103e2
[#198] StarSummaryView로 네이밍 변경
CJiu01 Feb 20, 2025
4c9c5aa
[#198] StarRatingView 컴포넌트 구현
CJiu01 Feb 20, 2025
050794b
[#198] cell selection 막기
CJiu01 Feb 22, 2025
eaf21d7
[#198] ReviewListTableViewHeader 레이아웃 깨짐 해결
CJiu01 Feb 23, 2025
ede59ab
[#198] ReactionView 레이아웃 깨짐 해결
CJiu01 Feb 23, 2025
10c71d7
[#198] TopStackView 레이아웃 깨짐 해결
CJiu01 Feb 23, 2025
56f95e3
[#198] MenuChipCollectionViewCell 레이아웃 깨짐 해결
CJiu01 Feb 25, 2025
bbb4974
[#198] 레이아웃 임시 수정코드 반영
CJiu01 Mar 3, 2025
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 @@ -10,7 +10,7 @@ import UIKit
import EATSSUDesign

import FirebaseAnalytics
import GoogleMobileAds
//import GoogleMobileAds
import Moya
import SnapKit

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//
// ChartComponentView.swift
// EATSSU
//
// Created by 최지우 on 2/18/25.
//

import UIKit

import EATSSUDesign
import SnapKit

final class ChartComponentView: BaseUIView {

private lazy var chartBarView = UIView()

private let pointLabel: UILabel = {
let label = UILabel()
label.text = "5점"
label.font = EATSSUDesignFontFamily.Pretendard.medium.font(size: 12)
return label
}()

public var chartBarBackgroundView: UIView = {
let view = UIView()
view.backgroundColor = EATSSUDesignAsset.Color.GrayScale.gray200.color
view.layer.cornerRadius = 5
return view
}()

public var chartBarforegroundView: UIView = {
let view = UIView()
view.backgroundColor = EATSSUDesignAsset.Color.Main.primary.color
view.layer.cornerRadius = 5
return view
}()

private lazy var chartComponentStackView: UIStackView = {
let stackView = UIStackView(arrangedSubviews: [pointLabel, chartBarView])
stackView.axis = .horizontal
stackView.spacing = 9
return stackView
}()

override func configureUI() {
chartBarView.addSubviews(chartBarBackgroundView,
chartBarforegroundView)
addSubviews(chartComponentStackView)
}

override func setLayout() {
chartBarView.snp.makeConstraints { make in
make.width.equalTo(115.adjusted)
make.height.equalTo(10.adjusted)
}
chartBarforegroundView.snp.makeConstraints { make in
make.width.equalTo(80.adjusted)
make.height.equalTo(10.adjusted)
make.top.leading.equalToSuperview()
}
chartBarBackgroundView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
chartComponentStackView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
//
// MenuChipCollectionViewCell.swift
// EATSSU-DEV
//
// Created by 최지우 on 2/2/25.
//

import UIKit
import SnapKit

import EATSSUDesign

final class MenuChipCollectionViewCell: UICollectionViewCell {
static let id = "MenuChipCollectionViewCell"

private let menuChipView: UIView = {
let view = UIView()
view.backgroundColor = EATSSUDesignAsset.Color.Main.secondary.color
view.layer.cornerRadius = 10
view.layer.borderColor = EATSSUDesignAsset.Color.Main.primary.color.cgColor
view.layer.borderWidth = 0.5
view.backgroundColor = .purple
return view
}()

private let thumbsupImageView: UIImageView = {
let imageView = UIImageView(image: EATSSUDesignAsset.Images.filledThumbUp.image)
imageView.contentMode = .scaleAspectFit
return imageView
}()

private let menuLabel: UILabel = {
let label = UILabel()
label.font = EATSSUDesignFontFamily.Pretendard.medium.font(size: 10)
label.textColor = EATSSUDesignAsset.Color.Main.primary.color
label.text = "김치볶음바바바밥"
return label
}()

lazy var menuChipStackView: UIStackView = {
let stackView = UIStackView(arrangedSubviews: [thumbsupImageView, menuLabel])
stackView.axis = .horizontal
stackView.spacing = 1
stackView.alignment = .center
stackView.backgroundColor = .green
return stackView
}()

override init(frame: CGRect) {
super.init(frame: frame)

configureUI()
setLayout()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

private func configureUI() {
addSubview(menuChipView)
menuChipView.addSubviews(menuChipStackView)
}

private func setLayout() {
thumbsupImageView.snp.makeConstraints { make in
make.width.height.equalTo(12)
}
menuLabel.snp.makeConstraints { make in
make.height.greaterThanOrEqualTo(12)
}
menuChipStackView.snp.makeConstraints { make in
make.edges.equalToSuperview().inset(5)
make.height.greaterThanOrEqualTo(12)
}
}

override func prepareForReuse() {
super.prepareForReuse()
self.prepare(name: nil)
}

func prepare(name: String?) {
self.menuLabel.text = name
setupDynamicLayout()
}

private func setupDynamicLayout() {
menuLabel.sizeToFit()
let viewSize = menuLabel.intrinsicContentSize
let width = viewSize.width + 30
let height = viewSize.height + 48

menuChipView.snp.remakeConstraints { make in
make.width.equalTo(width)
make.height.equalTo(height)
}

menuChipStackView.snp.remakeConstraints { make in
make.width.equalTo(width)
make.height.equalTo(height)
}

layoutIfNeeded()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
//
// MenuChipHorizontalScrollView.swift
// EATSSU-DEV
//
// Created by 최지우 on 1/30/25.
//

import UIKit

import EATSSUDesign

class MenuChipHorizontalScrollView: BaseUIView {

// MARK: - Properties
var menuDataSource: [String]? {
didSet { bind() }
}

lazy var horizontalScrollView: UIScrollView = {
let scrollView = UIScrollView()
scrollView.showsHorizontalScrollIndicator = false
return scrollView
}()

private lazy var stackView: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.spacing = 4
return stackView
}()

override func configureUI() {
horizontalScrollView.addSubview(stackView)
addSubview(horizontalScrollView)
}

override func setLayout() {
stackView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}

horizontalScrollView.snp.makeConstraints { make in
make.center.width.equalToSuperview()
make.height.equalTo(stackView)
make.trailing.equalToSuperview()
}
}

private func bind() {
menuDataSource?.forEach { menuData in
let button = createButton(menuData)
stackView.addArrangedSubview(button)
debugPrint(menuData)
}
}

private func createButton(_ title: String) -> UIButton {
var config = UIButton.Configuration.borderedTinted()
config = configureButton(config, title)
return UIButton(configuration: config)
}

private func configureButton(_ config: UIButton.Configuration, _ title: String) -> UIButton.Configuration {
var config = config

let attributedString = AttributedString(
title,
attributes: AttributeContainer([
.font: EATSSUDesignFontFamily.Pretendard.medium.font(size: 10),
.foregroundColor: EATSSUDesignAsset.Color.Main.primary.color]))
config.attributedTitle = attributedString

config.baseBackgroundColor = EATSSUDesignAsset.Color.Main.secondary.color
config.background.strokeColor = EATSSUDesignAsset.Color.Main.primary.color
config.background.strokeWidth = 0.5

config.image = EATSSUDesignAsset.Images.filledThumbUp.image
config.imagePadding = 1
config.cornerStyle = .capsule
config.contentInsets = NSDirectionalEdgeInsets(top: 5, leading: 6, bottom: 5, trailing: 6)

return config
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// ReactionView.swift
// EATSSU
//
// Created by 최지우 on 2/11/25.
//

import UIKit

import EATSSUDesign
import SnapKit

final class ReactionView: BaseUIView {

// MARK: - UI Components

private let likeImageView: UIImageView = {
let imageView = UIImageView(image: EATSSUDesignAsset.Images.like.image)
imageView.contentMode = .scaleAspectFit
return imageView
}()

private let likeCountLabel: UILabel = {
let label = UILabel()
label.text = "3"
label.font = EATSSUDesignFontFamily.Pretendard.medium.font(size: 12)
return label
}()

lazy var stackView: UIStackView = {
let stackView = UIStackView(arrangedSubviews: [likeImageView, likeCountLabel])
stackView.axis = .horizontal
stackView.spacing = 3
return stackView
}()

// MARK: - Functions

override func configureUI() {
addSubview(stackView)
}

override func setLayout() {
stackView.snp.makeConstraints { make in
make.height.equalTo(20)
}
}
}
Loading