mirror of
https://github.com/we-promise/sure.git
synced 2026-05-29 23:39:03 +00:00
refactor(settings/providers): align with DS conventions
Two consistency wins from the screenshot/DS audit pass. Sync icon button now renders DS::Button (variant: icon, size: sm) instead of a hand-rolled `button_to`. Same component used by other icon-only actions across the app (settings/profiles, layouts/imports). Visual delta: 28×28 → 32×32 (DS sm size). Accept the +4px for consistency. `event.stopPropagation()` still wired via the form opt so the row's <details> doesn't toggle when the user clicks the button. Group heading now follows the established Sure section-label style (`text-xs font-medium text-secondary uppercase`) used by `_settings_nav` and the imports/categories surfaces. The previous sentence-case `text-sm text-primary` was a one-off that didn't match the rest of the app. Locale strings stay sentence-case; uppercase comes from CSS `text-transform`. Tests updated to case-insensitively match the rendered heading text.
This commit is contained in:
committed by
Guillem Arias
parent
41cd6418dd
commit
ee798aed9e
@@ -1,12 +1,15 @@
|
||||
<%# locals: (provider_key:, last_synced_at: nil) %>
|
||||
<% recently_synced = last_synced_at.present? && last_synced_at > 60.seconds.ago %>
|
||||
<% button_label = recently_synced ? t("settings.providers.recently_synced") : t("settings.providers.sync_provider") %>
|
||||
<%= button_to sync_provider_settings_providers_path(provider_key: provider_key),
|
||||
method: :post,
|
||||
disabled: recently_synced,
|
||||
title: button_label,
|
||||
aria: { label: button_label },
|
||||
class: "inline-flex items-center justify-center w-7 h-7 rounded-md text-secondary hover:text-primary hover:bg-alpha-black-50 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",
|
||||
form: { onclick: "event.stopPropagation()", class: "inline-flex" } do %>
|
||||
<%= icon "refresh-cw", size: "sm", class: "!w-3.5 !h-3.5" %>
|
||||
<% end %>
|
||||
<%= render DS::Button.new(
|
||||
variant: "icon",
|
||||
size: "sm",
|
||||
icon: "refresh-cw",
|
||||
href: sync_provider_settings_providers_path(provider_key: provider_key),
|
||||
method: :post,
|
||||
disabled: recently_synced,
|
||||
title: button_label,
|
||||
aria: { label: button_label },
|
||||
class: "disabled:opacity-40 disabled:cursor-not-allowed",
|
||||
form: { onclick: "event.stopPropagation()", class: "inline-flex" }
|
||||
) %>
|
||||
|
||||
Reference in New Issue
Block a user