Skip to content

Commit

Permalink
Add a submit state to buttons, like Saving... (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
krschacht committed Apr 26, 2024
1 parent 1db2d8d commit dc6413f
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 9 deletions.
6 changes: 3 additions & 3 deletions app/views/messages/_main_column.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
Open new chat
</figcaption>
<kbd class="w-50 text-right flex flex-row gap-1">
<div class="key">Ctrl /</div>
<div class="key">Ctrl or</div>
<div class="key">J</div>
</kbd>
</figure>
Expand Down Expand Up @@ -331,7 +331,7 @@
</figcaption>
<kbd class="w-50 text-right flex flex-row gap-1">
<div class="key">Shift</div>
<div class="key">Ctrl /</div>
<div class="key">Ctrl or</div>
<div class="key">C</div>
</kbd>
</figure>
Expand All @@ -340,7 +340,7 @@
Toggle sidebar
</figcaption>
<kbd class="w-50 text-right flex flex-row gap-1">
<div class="key">Ctrl /</div>
<div class="key">Ctrl or</div>
<div class="key">.</div>
</kbd>
</figure>
Expand Down
5 changes: 4 additions & 1 deletion app/views/messages/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@

<div class="flex justify-center items-center text-sm font-medium">
<%= form.submit "Save & Submit",
data: { role: "save" },
data: {
role: "save",
turbo_submits_with: "Saving..."
},
class: %|
inline-block cursor-pointer
rounded-lg py-2 px-3
Expand Down
12 changes: 11 additions & 1 deletion app/views/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
placeholder: "Password",
class: "border border-gray-400 rounded p-3 dark:text-black"
%>
<%= f.submit "Log In", class: 'text-white bg-brand-blue dark:bg-gray-900 border border-white dark:border-gray-400 rounded-lg font-medium p-4 text-center cursor-pointer hover:opacity-95' %>
<%= f.submit "Log In",
class: %|
text-white font-medium
bg-brand-blue dark:bg-gray-900
border border-white dark:border-gray-400
rounded-lg p-4 text-center
cursor-pointer
hover:opacity-95
|,
data: { turbo_submits_with: "Authenticating..." }
%>
<% end %>
</div>
11 changes: 10 additions & 1 deletion app/views/settings/assistants/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,14 @@
%>
</div>

<%= form.submit "Save", class: "rounded-lg py-3 px-5 bg-gray-200 dark:bg-gray-900 border border-gray-400 inline-block font-medium cursor-pointer" %>
<%= form.submit "Save",
class: %|
inline-block font-medium
bg-gray-200 dark:bg-gray-900
border border-gray-400
rounded-lg py-3 px-5
cursor-pointer
|,
data: { turbo_submits_with: "Saving..." }
%>
<% end %>
9 changes: 8 additions & 1 deletion app/views/settings/people/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,14 @@

<div class="inline">
<%= form.submit "Save",
class: "rounded-lg py-3 px-5 bg-gray-200 dark:bg-gray-900 border border-gray-400 inline-block font-medium cursor-pointer"
class: %|
inline-block font-medium
bg-gray-200 dark:bg-gray-900
border border-gray-400
rounded-lg py-3 px-5
cursor-pointer
|,
data: { turbo_submits_with: "Saving..." }
%>
<%= link_to "Cancel", root_path, class: "float-right inline-block ml-5 py-3" %>
</div>
Expand Down
14 changes: 12 additions & 2 deletions app/views/users/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,24 @@
data-transition-target="transitionable">

<%= user_fields.label :name, class: "input input-bordered flex items-center justify-between" do %>
<span>Name <span class="">*</span></span>
<span>Full Name <span class="">*</span></span>
<%= user_fields.text_field :name,
placeholder: "First & Last name",
class: "w-44 border-0 dark:text-black"
%>
<% end %>
</div>
<% end %>
<%= f.submit "Sign Up", class: 'text-white bg-brand-blue dark:bg-gray-900 border border-white dark:border-gray-400 rounded-lg font-medium p-4 text-center cursor-pointer hover:opacity-95' %>
<%= f.submit "Sign Up",
class: %|
text-white font-medium
bg-brand-blue dark:bg-gray-900
border border-white dark:border-gray-400
rounded-lg p-4 text-center
cursor-pointer
hover:opacity-95
|,
data: { turbo_submits_with: "Creating..." }
%>
<% end %>
</div>

0 comments on commit dc6413f

Please sign in to comment.