File tree Expand file tree Collapse file tree
src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments