Skip to content

Commit 0f4b4f4

Browse files
committed
fix(leave dialog): Re-align buttons
With the latest refactoring of the link style the leave link button visually broke. Let's reimagine this dialog. (cherry picked from commit ee82435)
1 parent 9cd46ea commit 0f4b4f4

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

app/assets/builds/alchemy/admin.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/stylesheets/alchemy/admin/base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ body {
6666
overflow: hidden;
6767
}
6868

69-
&:has(:not(:defined)) {
69+
&:has(alchemy-spinner:not(:defined)) {
7070
opacity: var(--custom-elements-loaded, 0);
7171
}
7272
}

app/stylesheets/alchemy/admin/dialogs.scss

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,17 @@
192192
}
193193

194194
.buttons {
195-
text-align: right;
196-
197-
label {
198-
float: left;
199-
margin-top: var(--spacing-3);
195+
display: grid;
196+
grid-template-columns: 1fr 1fr;
197+
grid-auto-rows: auto;
198+
gap: var(--spacing-3);
199+
align-items: center;
200+
margin-top: 2em;
201+
margin-bottom: 0;
202+
203+
> .button {
204+
width: 100%;
205+
white-space: nowrap;
200206
}
201207
}
202208
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<%= render_message do %>
22
<%= Alchemy.t("You are about to leave Alchemy") %>
33
<% end %>
4-
<div data-turbo="false">
5-
<p class="buttons">
6-
<label><%= Alchemy.t("Do you want to") %></label>
7-
<%= link_to Alchemy.t('stay logged in'), alchemy.root_path, class: 'button secondary' %>
8-
</p>
9-
<%= form_tag Alchemy.config.logout_path, method: Alchemy.config.logout_method, class: 'buttons' do %>
10-
<label><%= Alchemy.t('or to completely') %></label>
4+
<%= form_tag Alchemy.config.logout_path, method: Alchemy.config.logout_method do %>
5+
<div class="buttons">
6+
<%= link_to Alchemy.t("stay logged in"),
7+
alchemy.root_path,
8+
rel: "noreferrer",
9+
data: {turbo: false},
10+
class: "button secondary" %>
1111
<%= button_tag Alchemy.t(:logout), autofocus: true %>
12-
<% end %>
13-
</div>
12+
</div>
13+
<% end %>

app/views/layouts/alchemy/admin.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<label>#{Alchemy.t(:leave)}</label>
6262
).html_safe,
6363
alchemy.leave_admin_path, {
64-
size: "300x155",
64+
size: "320x140",
6565
title: Alchemy.t("Leave Alchemy")
6666
}, {'data-alchemy-hotkey' => 'alt+q'}) %>
6767
<% else %>

0 commit comments

Comments
 (0)