More comments

This commit is contained in:
David Langley
2022-10-12 14:32:48 +01:00
parent f8da168065
commit b335de33aa
4 changed files with 45 additions and 13 deletions
@@ -19,16 +19,24 @@ import WysiwygComposer
struct FormattingToolbar: View {
// MARK: - Properties
// MARK: Private
// MARK: Public
@Environment(\.theme) private var theme: ThemeSwiftUI
/// The list of items to render in the toolbar
var formatItems: [FormatItem]
/// The action when an item is selected
var formatAction: (FormatType) -> ()
var body: some View {
HStack {
ForEach(formatItems) { item in
Button {
print("action")
formatAction(item.type)
} label: {
Image(item.icon)
@@ -45,6 +53,8 @@ struct FormattingToolbar: View {
}
}
// MARK: - Previews
struct FormattingToolbar_Previews: PreviewProvider {
static var previews: some View {
FormattingToolbar(formatItems: [