Skip to content

Commit

Permalink
Add standard button type
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Apr 30, 2024
1 parent 88c910c commit e3f735e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/SwiftUIKit/Buttons/Button+Standard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI

public extension Button {

/// This is a standard add button.
/// Create a new ``StandardType``-based button.
init(
_ type: StandardType,
_ title: LocalizedStringKey? = nil,
Expand Down Expand Up @@ -42,7 +42,7 @@ public extension Button {

public extension Button.StandardType {

var id: String{ rawValue }
var id: String { rawValue }

var image: Image? {
guard let imageName else { return nil }
Expand Down
6 changes: 5 additions & 1 deletion Sources/SwiftUIKit/Lists/ListShelfSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ public struct ListShelfSection<Title: View, Content: View>: View {

struct PreviewSection: View {

func printText() {
print("Tapped")
}

func button(_ index: Int) -> some View {
Button(action: {}) {
Button(action: printText) {
Text("Preview.Button.\(index)", bundle: .module)
}
}
Expand Down

0 comments on commit e3f735e

Please sign in to comment.