@@ -22,51 +22,56 @@ public struct PokitDeleteBottomSheet: View {
2222 }
2323
2424 public var body : some View {
25- VStack ( spacing: 0 ) {
26- /// - 텍스트 영역
27- VStack ( spacing: 8 ) {
28- Text ( type. sheetTitle)
29- . foregroundStyle ( . pokit( . text( . primary) ) )
30- . pokitFont ( . title2)
31- Text ( type. sheetContents)
32- . fixedSize ( horizontal: false , vertical: true )
33- . multilineTextAlignment ( . center)
34- . foregroundStyle ( . pokit( . text( . secondary) ) )
35- . pokitFont ( . b2( . m) )
25+ GeometryReader { proxy in
26+ let bottomSafeArea = proxy. safeAreaInsets. bottom
27+
28+ VStack ( spacing: 0 ) {
29+ /// - 텍스트 영역
30+ VStack ( spacing: 8 ) {
31+ Text ( type. sheetTitle)
32+ . foregroundStyle ( . pokit( . text( . primary) ) )
33+ . pokitFont ( . title2)
34+ Text ( type. sheetContents)
35+ . fixedSize ( horizontal: false , vertical: true )
36+ . multilineTextAlignment ( . center)
37+ . foregroundStyle ( . pokit( . text( . secondary) ) )
38+ . pokitFont ( . b2( . m) )
39+ }
40+ . padding ( . top, 36 )
41+ . padding ( . bottom, 20 )
42+ /// - 취소 / 삭제 버튼 영역
43+ HStack ( spacing: 8 ) {
44+ PokitBottomButton (
45+ " 취소 " ,
46+ state: . default( . primary) ,
47+ action: { delegateSend ? ( . cancelButtonTapped) }
48+ )
49+
50+ PokitBottomButton (
51+ " 삭제 " ,
52+ state: . filled( . primary) ,
53+ action: { delegateSend ? ( . deleteButtonTapped) }
54+ )
55+ }
3656 }
37- . padding ( . top, 36 )
38- . padding ( . bottom, 20 )
39- /// - 취소 / 삭제 버튼 영역
40- HStack ( spacing: 8 ) {
41- PokitBottomButton (
42- " 취소 " ,
43- state: . default( . primary) ,
44- action: { delegateSend ? ( . cancelButtonTapped) }
45- )
46-
47- PokitBottomButton (
48- " 삭제 " ,
49- state: . filled( . primary) ,
50- action: { delegateSend ? ( . deleteButtonTapped) }
51- )
57+ . padding ( . horizontal, 20 )
58+ . padding ( . bottom, 36 - bottomSafeArea)
59+ . background ( . white)
60+ . pokitPresentationCornerRadius ( )
61+ . pokitPresentationBackground ( )
62+ . presentationDragIndicator ( . visible)
63+ . readHeight ( )
64+ . onPreferenceChange ( HeightPreferenceKey . self) { height in
65+ if let height {
66+ self . height = height
67+ }
5268 }
53- }
54- . padding ( . horizontal, 20 )
55- . background ( . white)
56- . pokitPresentationCornerRadius ( )
57- . pokitPresentationBackground ( )
58- . presentationDragIndicator ( . visible)
59- . readHeight ( )
60- . onPreferenceChange ( HeightPreferenceKey . self) { height in
61- if let height {
62- self . height = height
69+ . presentationDetents ( [ . height( self . height) ] )
70+ . onAppear {
71+ UINotificationFeedbackGenerator ( )
72+ . notificationOccurred ( . warning)
6373 }
6474 }
65- . presentationDetents ( [ . height( self . height) ] )
66- . onAppear {
67- UINotificationFeedbackGenerator ( )
68- . notificationOccurred ( . warning)
69- }
7075 }
7176}
7277//MARK: - Delegate
0 commit comments