Skip to content

Commit

Permalink
fix(Snackbar): change color for action button
Browse files Browse the repository at this point in the history
  • Loading branch information
jaranaz committed Sep 22, 2023
1 parent 9bfe335 commit 35ce5b7
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions Sources/MisticaSwiftUI/Components/Button/MisticaButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,41 @@ public extension ButtonStyle where Self == MisticaButtonStyle {
rightImage: withChevron ? .chevron : nil
)
}

static func misticaSnackbar(
small: Bool = false,
bleedingAlignment: ButtonBleedingAlignment = .none,
withChevron: Bool = false
) -> Self {
Self(
style: MisticaButton.Style(
bleedingAlignment: bleedingAlignment,
hasMinWidth: false,
styleByState: [
.normal: MisticaButton.StateStyle(
textColor: .textLinkSnackbar,
backgroundColor: .clear,
borderColor: .clear
),
.selected: MisticaButton.StateStyle(
textColor: .textLinkSnackbar,
backgroundColor: .buttonLinkBackgroundSelected,
borderColor: .clear
),
.disabled: MisticaButton.StateStyle(
textColor: .textLinkSnackbar,
backgroundColor: .clear,
borderColor: .clear
),
.loading: MisticaButton.StateStyle(
textColor: .textLinkSnackbar,
backgroundColor: .clear,
borderColor: .clear
)
]
),
small: small,
rightImage: withChevron ? .chevron : nil
)
}
}
2 changes: 1 addition & 1 deletion Sources/MisticaSwiftUI/Components/Snackbar/Snackbar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private extension Snackbar {

var misticaButtonStyle: MisticaButtonStyle {
style == .normal
? .misticaLink(small: true, bleedingAlignment: .trailing)
? .misticaSnackbar(small: true, bleedingAlignment: .trailing)
: .misticaLinkInverse(small: true, bleedingAlignment: .trailing)
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 35ce5b7

Please sign in to comment.