Skip to content

Commit

Permalink
make the notes form use the correct button component
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Nov 9, 2024
1 parent 8a4b78f commit 3983acc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/helpers/components_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ def regular_button(id, value, variant: "secondary", state: "regular", size: "sli
end
end

def form_save_button
render Buttons::RegularButtonComponent.new(id: 'save-button', value: t('components.save_button'), variant: "primary", size: "slim", type: "submit") do |btn|
def form_save_button(enable_loading: true)
render Buttons::RegularButtonComponent.new(id: 'save-button', value: t('components.save_button'), variant: "primary", size: "slim", type: "submit", state: enable_loading ? 'animate' : '') do |btn|
btn.icon_left do
inline_svg_tag "check.svg"
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/notes/_new_comment.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
%div.form-group
%textarea.form-control.reply_body{cols: "1", name: "body", required: true, placeholder: t('notes.new_comment.comment'), rows: "1", style: "height: 100px;", tabindex: "0"}

= submit_tag t('notes.new_comment.save') , class:'btn btn-success btn-block'
= form_save_button(enable_loading: false)
2 changes: 1 addition & 1 deletion app/views/notes/_new_proposal.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
.form-group
= text_field_tag 'proposal[parent]','', placeholder: t('notes.new_proposal.parent'), class: "form-control", required: true

= submit_tag t('notes.new_proposal.save') , class:'btn btn-success btn-block'
= form_save_button(enable_loading: false)

0 comments on commit 3983acc

Please sign in to comment.