Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions Modules/Sources/DesignSystem/Components/FAB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,40 @@ public struct FAB: View {
self.action = action
}

#if compiler(>=6.2)
public var body: some View {
content
.dynamicTypeSize(...DynamicTypeSize.accessibility1) // important to be attached from the outside
if #available(iOS 26, *) {
Button(action: action ?? {}) {
Image(systemName: "plus")
.font(.system(size: 24, weight: .semibold))
.frame(width: 38, height: 38)
.foregroundStyle(Color(.systemBackground))
}
.buttonStyle(.glassProminent)
.buttonBorderShape(.circle)
.tint(Color(.label).opacity(0.8))
} else {
legacy
}
}
#else
public var body: some View {
legacy
}
#endif

@ViewBuilder
private var content: some View {
if let action {
Button(action: action) {
private var legacy: some View {
Group {
if let action {
Button(action: action) {
FABContentView(image: image)
}
} else {
FABContentView(image: image)
}
} else {
FABContentView(image: image)
}
.dynamicTypeSize(...DynamicTypeSize.accessibility1) // important to be attached from the outside
}
}

Expand Down