File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed
Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -15,21 +15,26 @@ public struct TPopupAlertState: Equatable {
1515 public var title : String
1616 /// 팝업 메시지 (옵션)
1717 public var message : String ?
18+ /// 팝업의 경고 아이콘 표시 (옵션)
19+ public var showAlertIcon : Bool
1820 /// 팝업에 표시될 버튼 배열
1921 public var buttons : [ ButtonState ]
2022
2123 /// TPopupAlertState 초기화 메서드
2224 /// - Parameters:
2325 /// - title: 팝업의 제목
2426 /// - message: 팝업의 메시지 (선택 사항, 기본값: `nil`)
27+ /// - showAlertIcon: 팝업의 경고 아이콘 표시 (기본값: `false`)
2528 /// - buttons: 팝업에 표시할 버튼 배열 (기본값: 빈 배열)
2629 public init (
2730 title: String ,
2831 message: String ? = nil ,
32+ showAlertIcon: Bool = false ,
2933 buttons: [ ButtonState ] = [ ]
3034 ) {
3135 self . title = title
3236 self . message = message
37+ self . showAlertIcon = showAlertIcon
3338 self . buttons = buttons
3439 }
3540}
Original file line number Diff line number Diff line change @@ -23,10 +23,20 @@ public struct TPopUpAlertView: View {
2323 VStack ( spacing: 20 ) {
2424 // 텍스트 Section
2525 VStack ( spacing: 8 ) {
26- Text ( alertState. title)
27- . typographyStyle ( . heading3, with: . neutral900)
28- . multilineTextAlignment ( . center)
29- . padding ( . top, 20 )
26+ VStack ( spacing: 0 ) {
27+ if alertState. showAlertIcon {
28+ Image ( . icnWarning)
29+ . resizable ( )
30+ . frame ( width: 80 , height: 80 )
31+ } else {
32+ Color . clear
33+ . frame ( height: 20 )
34+ }
35+ Text ( alertState. title)
36+ . typographyStyle ( . heading3, with: . neutral900)
37+ . multilineTextAlignment ( . center)
38+ }
39+
3040 if let message = alertState. message {
3141 Text ( message)
3242 . typographyStyle ( . body2Medium, with: . neutral500)
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public struct TPopUpModifier<InnerContent: View>: ViewModifier {
2323 /// 팝업 그림자의 기본 반경
2424 private let defaultShadowRadius : CGFloat = 10
2525 /// 팝업 콘텐츠의 기본 크기
26- private let defaultContentSize : CGSize = . init( width: 297 , height: 175 )
26+ private let defaultContentSize : CGSize = . init( width: 297 , height: 151 )
2727
2828 /// 팝업에 표시될 내부 콘텐츠 클로저
2929 private let innerContent : ( ) -> InnerContent
You can’t perform that action at this time.
0 commit comments