-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature. 내 리뷰 관리 UI 작업 #177
Open
spqjf12345
wants to merge
8
commits into
develop
Choose a base branch
from
feature/#175-myReview
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ff40387
Add: MyReview 리블렛 생성 및 연결
spqjf12345 058e2fc
Etc: google package 업데이트
spqjf12345 f10e305
Update: charactorView 추가
spqjf12345 344a028
Add: Review product view 분리
spqjf12345 fb1ad98
Add: 내 리뷰 view 생성 및 연결
spqjf12345 36a89d3
Add: 내 리뷰 상세보기 리블렛 생성 및 연결
spqjf12345 c14e634
Update: 내 상세 리뷰 UI 구성
spqjf12345 d24eadc
Etc: 레이아웃 수정, myReview detach 연결
spqjf12345 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
108 changes: 104 additions & 4 deletions
108
Pyonsnal-Color/Pyonsnal-Color.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
Pyonsnal-Color/Pyonsnal-Color/Common/Cell/ActionButtonCell/ActionButtonCell.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// | ||
// ActionButtonCell.swift | ||
// Pyonsnal-Color | ||
// | ||
// Created by 조소정 on 6/2/24. | ||
// | ||
|
||
import UIKit | ||
import Combine | ||
|
||
protocol ActionButtonCellDelegate: AnyObject { | ||
func actionButtonDidTap() | ||
} | ||
|
||
final class ActionButtonCell: UICollectionViewCell { | ||
// MARK: - Interfaces | ||
enum Constants { | ||
enum Size { | ||
static let actionButtonHeight: CGFloat = 40 | ||
static let actionButtonRadius: CGFloat = 16 | ||
} | ||
|
||
enum Text { | ||
static let writeReview = "상품 리뷰 작성 하기" | ||
static let showProduct = "상품 보러 가기" | ||
} | ||
} | ||
|
||
weak var delegate: ActionButtonCellDelegate? | ||
private var cancellables = Set<AnyCancellable>() | ||
|
||
// MARK: - Initializer | ||
override init(frame: CGRect) { | ||
super.init(frame: .zero) | ||
self.setConstraints() | ||
self.bindActions() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
let actionButton: UIButton = { | ||
let button = UIButton(frame: .zero) | ||
button.makeRounded(with: Constants.Size.actionButtonRadius) | ||
button.backgroundColor = .black | ||
button.titleLabel?.textColor = .white | ||
button.titleLabel?.font = .body2m | ||
return button | ||
}() | ||
|
||
// MARK: - Private Methods | ||
private func setConstraints() { | ||
self.addSubview(actionButton) | ||
actionButton.snp.makeConstraints { make in | ||
make.height.equalTo(Constants.Size.actionButtonHeight) | ||
make.top.bottom.equalToSuperview() | ||
make.leading.trailing.equalToSuperview().inset(.spacing16) | ||
} | ||
} | ||
|
||
private func bindActions() { | ||
actionButton.tapPublisher.sink { [weak self] in | ||
self?.delegate?.actionButtonDidTap() | ||
}.store(in: &cancellables) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
Pyonsnal-Color/Pyonsnal-Color/Common/Review/ProductInfoStackView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
// | ||
// ProductInfoStackView.swift | ||
// Pyonsnal-Color | ||
// | ||
// Created by 조소정 on 5/19/24. | ||
// | ||
|
||
import UIKit | ||
import SnapKit | ||
|
||
class ProductInfoStackView: UIStackView { | ||
enum Mode { | ||
case starRating // 별점 | ||
case date // 날짜 | ||
case tastes // 취향 태그 | ||
} | ||
|
||
let productImageView: UIImageView = { | ||
let imageView = UIImageView() | ||
imageView.makeBorder(width: 1, color: UIColor.gray200.cgColor) | ||
imageView.makeRounded(with: .spacing16) | ||
return imageView | ||
}() | ||
|
||
private let productInformationStackView: UIStackView = { | ||
let stackView = UIStackView() | ||
stackView.axis = .vertical | ||
stackView.spacing = .spacing8 | ||
stackView.alignment = .leading | ||
stackView.distribution = .equalSpacing | ||
return stackView | ||
}() | ||
|
||
let storeImageView: UIImageView = { | ||
let imageView = UIImageView() | ||
imageView.contentMode = .scaleAspectFit | ||
return imageView | ||
}() | ||
|
||
let productNameLabel: UILabel = { | ||
let label = UILabel() | ||
label.font = .body3m | ||
label.numberOfLines = 2 | ||
return label | ||
}() | ||
|
||
lazy var starRatedView = StarRatedView(score: 0) | ||
|
||
let dateLabel: UILabel = { | ||
let label = UILabel() | ||
label.font = .body3r | ||
label.textColor = .gray400 | ||
return label | ||
}() | ||
|
||
let tastesLabel: UILabel = { | ||
let label = UILabel() | ||
label.font = .body3r | ||
label.textColor = .red500 | ||
label.numberOfLines = 2 | ||
return label | ||
}() | ||
|
||
init(mode: Mode) { | ||
super.init(frame: .zero) | ||
self.initialize() | ||
self.configureView() | ||
self.addArrangedSubview(with: mode) | ||
} | ||
|
||
required init(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
func setTastes(tastesTag: [String]) { | ||
let tastes = tastesTag.map { "# \($0)"}.joined(separator: " ") | ||
self.tastesLabel.text = tastes | ||
} | ||
|
||
private func initialize() { | ||
self.axis = .horizontal | ||
self.alignment = .center | ||
self.spacing = .spacing16 | ||
self.isLayoutMarginsRelativeArrangement = true | ||
self.layoutMargins = .init( | ||
top: .spacing24, | ||
left: .spacing16, | ||
bottom: .spacing24, | ||
right: .spacing16 | ||
) | ||
} | ||
|
||
private func configureView() { | ||
self.addArrangedSubview(productImageView) | ||
self.addArrangedSubview(productInformationStackView) | ||
|
||
self.productInformationStackView.addArrangedSubview(storeImageView) | ||
self.productInformationStackView.addArrangedSubview(productNameLabel) | ||
self.productNameLabel.setContentCompressionResistancePriority(.defaultHigh, for: .vertical) | ||
self.tastesLabel.setContentCompressionResistancePriority(.defaultLow, for: .vertical) | ||
|
||
self.productImageView.snp.makeConstraints { | ||
$0.width.height.equalTo(100) | ||
} | ||
|
||
self.storeImageView.snp.makeConstraints { | ||
$0.height.equalTo(20) | ||
} | ||
} | ||
|
||
private func addArrangedSubview(with mode: Mode) { | ||
switch mode { | ||
case .starRating: | ||
self.productInformationStackView.addArrangedSubview(starRatedView) | ||
case .date: | ||
self.productInformationStackView.addArrangedSubview(dateLabel) | ||
case .tastes: | ||
self.productInformationStackView.addArrangedSubview(tastesLabel) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤩👍