Skip to content

Commit

Permalink
Update flow
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovic35 committed Jan 25, 2024
1 parent e398e17 commit 67b4136
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//

import SwiftUI
import Flow

/// A banner displays an important message which requires an
/// action to be dismissed.
Expand Down Expand Up @@ -105,7 +106,7 @@ public struct ODSBanner: View {
.padding(.bottom, firstButton == nil ? ODSSpacing.m : ODSSpacing.none)
.padding(.horizontal, ODSSpacing.m)

bottomButtons()
buttons()
}

Divider()
Expand All @@ -117,13 +118,18 @@ public struct ODSBanner: View {
// =============

@ViewBuilder
private func bottomButtons() -> some View {
private func buttons() -> some View {
if let firstButton = firstButton {
HStack(spacing: ODSSpacing.none) {
firstButton()
.odsEmphasisButtonStyle(emphasis: .lowest)
secondButton?()
.odsEmphasisButtonStyle(emphasis: .lowest)
if #available(iOS 16.0, *) {
HFlow(alignment: .top, spacing: ODSSpacing.none) {
firstButton().odsEmphasisButtonStyle(emphasis: .lowest)
secondButton?().odsEmphasisButtonStyle(emphasis: .lowest)
}
} else {
HStack(alignment: .center, spacing: ODSSpacing.none) {
firstButton().odsEmphasisButtonStyle(emphasis: .lowest)
secondButton?().odsEmphasisButtonStyle(emphasis: .lowest)
}
}
}
}
Expand Down

0 comments on commit 67b4136

Please sign in to comment.