File tree Expand file tree Collapse file tree 1 file changed +31
-7
lines changed
Modules/Sources/DesignSystem/Components Expand file tree Collapse file tree 1 file changed +31
-7
lines changed Original file line number Diff line number Diff line change @@ -10,19 +10,43 @@ public struct FAB: View {
10
10
}
11
11
12
12
public var body : some View {
13
- content
14
- . dynamicTypeSize ( ... DynamicTypeSize . accessibility1) // important to be attached from the outside
13
+ #if compiler(>=6.2)
14
+ if #available( iOS 26 , * ) {
15
+ modern
16
+ } else {
17
+ legacy
18
+ }
19
+ #else
20
+ legacy
21
+ #endif
15
22
}
16
23
24
+ @available ( iOS 26 , * )
17
25
@ViewBuilder
18
- private var content : some View {
19
- if let action {
20
- Button ( action: action) {
26
+ private var modern : some View {
27
+ Button ( action: action ?? { } ) {
28
+ Image ( systemName: " plus " )
29
+ . font ( . system( size: 24 , weight: . semibold) )
30
+ . frame ( width: 38 , height: 38 )
31
+ . foregroundStyle ( Color ( . systemBackground) )
32
+ }
33
+ . buttonStyle ( . glassProminent)
34
+ . buttonBorderShape ( . circle)
35
+ . tint ( Color ( . label) . opacity ( 0.8 ) )
36
+ }
37
+
38
+ @ViewBuilder
39
+ private var legacy : some View {
40
+ Group {
41
+ if let action {
42
+ Button ( action: action) {
43
+ FABContentView ( image: image)
44
+ }
45
+ } else {
21
46
FABContentView ( image: image)
22
47
}
23
- } else {
24
- FABContentView ( image: image)
25
48
}
49
+ . dynamicTypeSize ( ... DynamicTypeSize . accessibility1) // important to be attached from the outside
26
50
}
27
51
}
28
52
You can’t perform that action at this time.
0 commit comments