Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Change structure of remove address button (#10511)

Aleksandra Kamińska1f28314b13a3
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index dfaceb2f09..608fbac486 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -508,6 +508,7 @@ en:
address_name_placeholder: Give this address a unique name (Work, Home, etc.)
new_address: "New Address"
edit_address: "Edit Address"
+ remove_address: Remove Address
no_shipping_addresses_on_file: "No addresses on file"
addresses: "Addresses"
successfully_created: "Address has been successfully created."
@@ -1642,7 +1643,7 @@ en:
stock_transfer:
errors:
must_have_variant: You must add at least one variant.
- variants_unavailable: "Some variants are not available on %{stock}"
+ variants_unavailable: "Some variants are not available on %{stock}"
stock_transfers: Stock Transfers
stop: Stop
store: Store
diff --git a/frontend/app/assets/stylesheets/spree/frontend/application.scss b/frontend/app/assets/stylesheets/spree/frontend/application.scss
index 95b4f12908..77243fb178 100644
--- a/frontend/app/assets/stylesheets/spree/frontend/application.scss
+++ b/frontend/app/assets/stylesheets/spree/frontend/application.scss
@@ -58,4 +58,3 @@
@import "spree/frontend/views/spree/shared/color_select";
@import "spree/frontend/views/spree/shared/dropdown";
@import "spree/frontend/views/spree/shared/delete_address_popup";
-@import "spree/frontend/views/spree/shared/address_book";
diff --git a/frontend/app/assets/stylesheets/spree/frontend/views/spree/shared/address_book.scss b/frontend/app/assets/stylesheets/spree/frontend/views/spree/shared/address_book.scss
deleted file mode 100644
index ea94ef52dc..0000000000
--- a/frontend/app/assets/stylesheets/spree/frontend/views/spree/shared/address_book.scss
+++ /dev/null
@@ -1,9 +0,0 @@
-.js-delete-address-link {
- svg {
- color: $primary-color;
- cursor: pointer;
- &:hover {
- color: darken($primary-color, 10);
- }
- }
-}
diff --git a/frontend/app/views/spree/users/_address_controls.html.erb b/frontend/app/views/spree/users/_address_controls.html.erb
index 2466d9ba39..9891b794b2 100644
--- a/frontend/app/views/spree/users/_address_controls.html.erb
+++ b/frontend/app/views/spree/users/_address_controls.html.erb
@@ -2,6 +2,10 @@
<%= inline_svg_tag('edit.svg', width: 24, height: 24) %>
<% end %>
-<span class="js-delete-address-link ml-3" data-address="<%= spree.address_path(address) %>">
- <%= inline_svg_tag('garbage_2.svg', width: 24, height: 24) %>
-</span>
+<%= link_to '#', class: 'js-delete-address-link ml-3', data: { turbolinks: false, hook: 'remove_address', address: spree.address_path(address) }, aria: { label: Spree.t('address_book.remove_address') } do %>
+ <%= icon(name: 'garbage_2',
+ classes: '',
+ width: 24,
+ height: 24)
+ %>
+<% end %>