@@ -50,11 +50,18 @@ public struct PokitSelect<Item: PokitSelectItem>: View {
5050 }
5151 . onChange ( of: selectedItem) { onChangedSeletedItem ( $0) }
5252 . sheet ( isPresented: $showSheet) {
53- listSheet
54- . presentationDragIndicator ( . visible)
55- . pokitPresentationCornerRadius ( )
56- . presentationDetents ( [ . height( 564 ) ] )
57- . pokitPresentationBackground ( )
53+ PokitSelectSheet (
54+ list: list,
55+ itemSelected: { item in
56+ listDismiss ( )
57+ action ( item)
58+ } ,
59+ pokitAddAction: addAction
60+ )
61+ . presentationDragIndicator ( . visible)
62+ . pokitPresentationCornerRadius ( )
63+ . presentationDetents ( [ . height( 564 ) ] )
64+ . pokitPresentationBackground ( )
5865 }
5966 }
6067
@@ -96,63 +103,6 @@ public struct PokitSelect<Item: PokitSelectItem>: View {
96103 . animation ( . pokitDissolve, value: self . state)
97104 }
98105
99- private var listSheet : some View {
100- Group {
101- if let list {
102- VStack ( spacing: 0 ) {
103- if let addAction {
104- addButton {
105- listDismiss ( )
106- addAction ( )
107- }
108- }
109-
110- PokitList (
111- selectedItem: selectedItem,
112- list: list
113- ) { item in
114- action ( item)
115- listCellTapped ( item)
116- }
117- }
118- . padding ( . top, 12 )
119- . padding ( . bottom, 20 )
120- } else {
121- PokitLoading ( )
122- }
123- }
124- }
125-
126- @ViewBuilder
127- private func addButton(
128- action: @escaping ( ) -> Void
129- ) -> some View {
130- Button ( action: action) {
131- HStack ( spacing: 20 ) {
132- PokitIconButton (
133- . icon( . plusR) ,
134- state: . default( . secondary) ,
135- size: . medium,
136- shape: . round,
137- action: action
138- )
139-
140- Text ( " 포킷 추가하기 " )
141- . pokitFont ( . b1( . b) )
142- . foregroundStyle ( . pokit( . text( . primary) ) )
143-
144- Spacer ( )
145- }
146- . padding ( . vertical, 22 )
147- . padding ( . horizontal, 30 )
148- . background ( alignment: . bottom) {
149- Rectangle ( )
150- . fill ( . pokit( . border( . tertiary) ) )
151- . frame ( height: 1 )
152- }
153- }
154- }
155-
156106 private func partSelectButtonTapped( ) {
157107 showSheet = true
158108 }
0 commit comments