@@ -272,50 +272,53 @@ private extension MainTabView {
272272 var action : ( TabAddSheetType ) -> Void
273273
274274 var body : some View {
275- HStack ( spacing: 20 ) {
276- Spacer ( )
277-
278- ForEach ( TabAddSheetType . allCases, id: \. self) { type in
279- Button ( action: { action ( type) } ) {
280- VStack ( spacing: 4 ) {
281- Spacer ( )
282-
283- type. icon
284- . renderingMode ( . template)
285- . resizable ( )
286- . aspectRatio ( contentMode: . fit)
287- . frame ( width: 28 , height: 28 )
288- . foregroundStyle ( . pokit( . icon( . inverseWh) ) )
289-
290- Text ( type. title)
291- . pokitFont ( . b3( . m) )
292- . foregroundStyle ( . pokit( . text( . inverseWh) ) )
293-
294- Spacer ( )
295- }
296- . padding ( . horizontal, 24 )
297- . background {
298- RoundedRectangle ( cornerRadius: 12 , style: . continuous)
299- . foregroundStyle ( . pokit( . bg( . brand) ) )
275+ GeometryReader { proxy in
276+ let bottomSafeArea = proxy. safeAreaInsets. bottom
277+ HStack ( spacing: 20 ) {
278+ Spacer ( )
279+
280+ ForEach ( TabAddSheetType . allCases, id: \. self) { type in
281+ Button ( action: { action ( type) } ) {
282+ VStack ( spacing: 4 ) {
283+ Spacer ( )
284+
285+ type. icon
286+ . renderingMode ( . template)
287+ . resizable ( )
288+ . aspectRatio ( contentMode: . fit)
289+ . frame ( width: 28 , height: 28 )
290+ . foregroundStyle ( . pokit( . icon( . inverseWh) ) )
291+
292+ Text ( type. title)
293+ . pokitFont ( . b3( . m) )
294+ . foregroundStyle ( . pokit( . text( . inverseWh) ) )
295+
296+ Spacer ( )
297+ }
298+ . padding ( . horizontal, 24 )
299+ . background {
300+ RoundedRectangle ( cornerRadius: 12 , style: . continuous)
301+ . foregroundStyle ( . pokit( . bg( . brand) ) )
302+ }
303+ . frame ( height: 96 )
300304 }
301- . frame ( height: 96 )
302305 }
306+
307+ Spacer ( )
303308 }
304-
305- Spacer ( )
306- }
307- . padding ( . top, 36 )
308- . padding ( . bottom, 48 )
309- . pokitPresentationCornerRadius ( )
310- . pokitPresentationBackground ( )
311- . presentationDragIndicator ( . visible)
312- . readHeight ( )
313- . onPreferenceChange ( HeightPreferenceKey . self) { height in
314- if let height {
315- self . height = height
309+ . padding ( . bottom, 48 - bottomSafeArea)
310+ . padding ( . top, 36 )
311+ . pokitPresentationCornerRadius ( )
312+ . pokitPresentationBackground ( )
313+ . presentationDragIndicator ( . visible)
314+ . readHeight ( )
315+ . onPreferenceChange ( HeightPreferenceKey . self) { height in
316+ if let height {
317+ self . height = height
318+ }
316319 }
320+ . presentationDetents ( [ . height( self . height) ] )
317321 }
318- . presentationDetents ( [ . height( self . height) ] )
319322 }
320323 }
321324}
0 commit comments