Skip to content

Commit

Permalink
Update sample
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinneko committed Nov 26, 2024
1 parent 55fc4b1 commit e7cf4a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public struct HintsView: View {
@State var isPresented2 = true

@State var isPresented3 = true

@State var isPresented4 = true

public var body: some View {
ScrollView {
Expand All @@ -17,7 +19,11 @@ public struct HintsView: View {

CharcoalHint(text: "ヒントテキストヒントテキスト", isPresenting: $isPresented2)

CharcoalHint(text: "ヒントテキストヒントテキスト", maxWidth: .infinity, isPresenting: $isPresented3)
CharcoalHint(text: "ヒントテキストヒントテキスト", maxWidth: .infinity, isPresenting: $isPresented3, alignment: .leading)

CharcoalHint(text: "ヒントテキストヒントテキスト", maxWidth: .infinity, isPresenting: $isPresented4, buttonStyle: .default, action: CharcoalAction(title: "Button") {
isPresented = false
})
}
.padding()
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/CharcoalSwiftUI/Components/Hint/CharcoalHint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public struct CharcoalHint: View {
subtitle: String? = nil,
maxWidth: CGFloat? = nil,
isPresenting: Binding<Bool>,
action: CharcoalAction? = nil,
alignment: Alignment = .center,
buttonStyle: CharcoalButtonStyle = .primary(Color(CharcoalAsset.ColorPaletteGenerated.brand.color))
buttonStyle: CharcoalButtonStyle = .primary(Color(CharcoalAsset.ColorPaletteGenerated.brand.color)),
action: CharcoalAction? = nil
) {
self.text = text
self.subtitle = subtitle
Expand Down Expand Up @@ -85,9 +85,9 @@ public struct CharcoalHint: View {
isPresenting = false
}))

CharcoalHint(text: "ヒントテキストヒントテキスト", isPresenting: $isPresenting2, action: CharcoalAction(title: "Button", actionCallback: {
CharcoalHint(text: "ヒントテキストヒントテキスト", isPresenting: $isPresenting2, buttonStyle: .default, action: CharcoalAction(title: "Button", actionCallback: {
isPresenting2 = false
}), buttonStyle: .default)
}))

CharcoalHint(text: "ヒントテキストヒントテキスト", isPresenting: $isPresenting3)

Expand Down

0 comments on commit e7cf4a0

Please sign in to comment.