Skip to content

Commit

Permalink
feat: 🎸 [JIRA:HCPSDKFIORIUIKIT-2717] Feedback Patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
hengyi-zhang committed Oct 28, 2024
1 parent 30125af commit 9142290
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,3 +631,12 @@ protocol _ToastMessageComponent: _IconComponent, _TitleComponent {
/// The duration in seconds for which the toast message is shown. The default is `1`.
var duration: Double { get }
}

protocol _BannerMultiMessageSheet: _TitleComponent, _CloseActionComponent {
var closeAction: () -> Void { get }
var removeAction: (String, UUID?) -> Void { get }
var viewDetailAction: (UUID) -> Void { get }
var turnOnSectionHeader: Bool { get }
// @ViewBuilder messageItemView: @escaping ((UUID) -> any View)
// var bannerMultiMessages: Binding<[BannerMessageListModel]
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ public struct BannerMessageBaseStyle: BannerMessageStyle {
}
}

struct BannerMessageErrorStyle: BannerMessageStyle {
public func makeBody(_ configuration: BannerMessageConfiguration) -> some View {
BannerMessage(configuration)
.iconStyle { c in
c.icon.foregroundStyle(BannerMessageFioriStyle.titleForegroundColor(type: configuration.messageType))
}
}
}

// Default fiori styles
extension BannerMessageFioriStyle {
static func titleForegroundColor(type: BannerMultiMessageType) -> Color {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ public struct BannerMultiMessageSheet: View {
}, bannerTapAction: {
self.showItemDetail(category: element.category, at: message.id)
}, alignment: .leading, hideSeparator: true, messageType: message.messageType)
.bannerMessageStyle(BannerMessageErrorStyle())
// .iconStyle(content: { c in
// c.icon.foregroundStyle(BannerMessageFioriStyle.titleForegroundColor(type: message.messageType))
// })
// .titleStyle(content: { c in
// c.title.foregroundStyle(BannerMessageFioriStyle.titleForegroundColor(type: message.messageType))
// })
.swipeActions(edge: .trailing, allowsFullSwipe: true) {
Button(role: .destructive) {
self.removeItem(category: element.category, at: message.id)
Expand Down

0 comments on commit 9142290

Please sign in to comment.