Skip to content

Commit

Permalink
Add disabled param to button preview (#2145)
Browse files Browse the repository at this point in the history
  • Loading branch information
langermank authored Jul 13, 2023
1 parent 148e6fe commit 4fccc17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions previews/primer/beta/button_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ def link(

# @label All schemes
# @snapshot
def all_schemes
render_with_template(locals: {})
# @param disabled toggle
def all_schemes(
disabled: false
)
render_with_template(locals: {
disabled: disabled,
})
end

# @label Full width
Expand Down
4 changes: 4 additions & 0 deletions previews/primer/beta/button_preview/all_schemes.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@
<%= render(Primer::Beta::Button.new(
scheme: :secondary,
size: :medium,
disabled: disabled
)) do %>
Button
<% end %>
<%= render(Primer::Beta::Button.new(
scheme: :primary,
size: :medium,
disabled: disabled
)) do %>
Button
<% end %>
<%= render(Primer::Beta::Button.new(
scheme: :invisible,
size: :medium,
disabled: disabled
)) do %>
Button
<% end %>
<%= render(Primer::Beta::Button.new(
scheme: :danger,
size: :medium,
disabled: disabled
)) do %>
Button
<% end %>
Expand Down

0 comments on commit 4fccc17

Please sign in to comment.