Skip to content

Commit c1d4691

Browse files
committed
[BOOK-379] feat: 감상평 부분 레이아웃 수정
1 parent c29ed7d commit c1d4691

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/AppreciationResultView.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ final class AppreciationResultView: BaseView {
4444
)
4545

4646
private let rootStackBackgroundView = UIView()
47-
private let rootStack: UIStackView = {
47+
private lazy var rootStack: UIStackView = {
4848
let stackView = UIStackView()
4949
stackView.axis = .vertical
5050
stackView.spacing = LayoutConstants.rootStackSpacing
@@ -139,12 +139,22 @@ final class AppreciationResultView: BaseView {
139139
func apply(
140140
emotion: EmotionIcon,
141141
creationDate: Date,
142-
appreciation: String = ""
142+
appreciation: String? = ""
143143
) {
144144
emotionIcon.image = emotion.icon
145145
emotionLabel.setText(text: emotion.rawValue)
146146
creationLabel.setText(text: creationDate.toKoreanDateString())
147-
appreciationLabel.setText(text: appreciation)
147+
148+
if let review = appreciation, !review.isEmpty {
149+
appreciationLabel.setText(text: review)
150+
rootStack.spacing = LayoutConstants.rootStackSpacing
151+
} else {
152+
rootStack.spacing = 0
153+
rootStack.removeArrangedSubview(appreciationLabel)
154+
}
155+
156+
rootStack.setNeedsLayout()
157+
rootStack.layoutIfNeeded()
148158
}
149159
}
150160

0 commit comments

Comments
 (0)