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.

Improve displaying items on storefront

Damian Legawiec1641163e7fc8
diff --git a/storefront/app/views/spree/checkout/_line_item.html.erb b/storefront/app/views/spree/checkout/_line_item.html.erb
index 8ac3a49b59..75d5edac97 100644
--- a/storefront/app/views/spree/checkout/_line_item.html.erb
+++ b/storefront/app/views/spree/checkout/_line_item.html.erb
@@ -1,11 +1,13 @@
<div class="flex justify-between items-center pt-3">
- <div class="mr-5 w-[60px] h-[60px] relative rounded bg-accent-100 shrink-0">
+ <div class="mr-5 relative shrink-0">
<span class="rounded-full text-xs text-center font-bold pl-[0.5px] py-1 w-6 text-sidebar-text bg-background absolute -right-2 -top-3">
<%= line_item.quantity %>
</span>
<% image = line_item.variant.default_image %>
<% if image.present? && image.attached? && image.variable? %>
- <%= spree_image_tag(image, class: 'rounded border border-default bg-transparent object-cover object-center', loading: :lazy, width: 60, height: 60) %>
+ <%= spree_image_tag(image, class: 'rounded border border-default bg-transparent object-cover object-center', loading: :lazy, width: 64, height: 64) %>
+ <% else %>
+ <div class="w-16 h-16 bg-accent border border-default rounded"></div>
<% end %>
</div>
<div class="flex-1 pr-3 text-sm">
diff --git a/storefront/app/views/themes/default/spree/orders/_line_item.html.erb b/storefront/app/views/themes/default/spree/orders/_line_item.html.erb
index 9df785b0f3..74631830d1 100644
--- a/storefront/app/views/themes/default/spree/orders/_line_item.html.erb
+++ b/storefront/app/views/themes/default/spree/orders/_line_item.html.erb
@@ -7,6 +7,8 @@
<%= link_to spree_storefront_resource_url(line_item.product), data: { 'turbo-frame': '_top' } do %>
<%= spree_image_tag(image, width: 128, height: 128, class: 'object-cover', loading: :lazy) %>
<% end %>
+ <% else %>
+ <div class="w-32 h-32 bg-accent"></div>
<% end %>
</div>
<div class="ml-3 w-full">
diff --git a/storefront/app/views/themes/default/spree/shared/_order_details.html.erb b/storefront/app/views/themes/default/spree/shared/_order_details.html.erb
index eae0525667..9549cf24df 100644
--- a/storefront/app/views/themes/default/spree/shared/_order_details.html.erb
+++ b/storefront/app/views/themes/default/spree/shared/_order_details.html.erb
@@ -26,7 +26,7 @@
<% if order.special_instructions.present? %>
<div class="p-4 lg:p-6 text-sm border">
- <div class="uppercase tracking-widest mb-1">
+ <div class="uppercase tracking-widest mb-2">
<%= I18n.t('activerecord.attributes.spree/order.special_instructions') %>
</div>
<div class="!leading-[1.375rem] text-neutral-800">
@@ -39,7 +39,7 @@
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-6 p-4 lg:p-6 text-sm bg-border bg-accent-100">
<!-- billing address -->
<div>
- <div class="uppercase tracking-widest">
+ <div class="uppercase tracking-widest mb-2">
<%= Spree.t(:billing_address) %>
</div>
<div class="!leading-[1.375rem] text-neutral-800">
@@ -48,7 +48,7 @@
</div>
<!-- payment into -->
<div class="mb-5 lg:mb-0">
- <div class="uppercase tracking-widest">
+ <div class="uppercase tracking-widest mb-2">
<%= Spree.t(:payment_information) %>
</div>
<div class="!leading-[1.375rem] text-neutral-800">
diff --git a/storefront/app/views/themes/default/spree/shared/_order_line_item.html.erb b/storefront/app/views/themes/default/spree/shared/_order_line_item.html.erb
index 234577c666..9e8f23bf12 100644
--- a/storefront/app/views/themes/default/spree/shared/_order_line_item.html.erb
+++ b/storefront/app/views/themes/default/spree/shared/_order_line_item.html.erb
@@ -8,6 +8,8 @@
<%= link_to spree_storefront_resource_url(line_item.product, relative: true) do %>
<%= spree_image_tag(image, width: 128, height: 128, loading: :lazy) %>
<% end %>
+ <% else %>
+ <div class="w-32 h-32 bg-accent"></div>
<% end %>
</div>
<div class="flex flex-col gap-2">
diff --git a/storefront/app/views/themes/default/spree/shared/_order_shipment.html.erb b/storefront/app/views/themes/default/spree/shared/_order_shipment.html.erb
index ba24e82e93..167eedbf14 100644
--- a/storefront/app/views/themes/default/spree/shared/_order_shipment.html.erb
+++ b/storefront/app/views/themes/default/spree/shared/_order_shipment.html.erb
@@ -3,7 +3,7 @@
<div class="flex flex-col lg:flex-row lg:gap-6 gap-4">
<% if shipment.order.requires_ship_address? %>
<div class="text-sm lg:w-1/2">
- <div class="tracking-widest uppercase mb-1">
+ <div class="tracking-widest uppercase mb-2">
<%= Spree.t(:delivery_address) %>
</div>
<div class="!leading-[1.375rem] text-neutral-800">
@@ -14,7 +14,7 @@
<% end %>
<div class="text-sm lg:w-1/2 lg:flex justify-between">
<div>
- <div class="tracking-widest uppercase mb-1">
+ <div class="tracking-widest uppercase mb-2">
<%= Spree.t(:shipping_method) %>
</div>
<div class="!leading-[1.375rem] text-neutral-800">
diff --git a/storefront/lib/generators/spree/storefront/install/templates/application.tailwind.css b/storefront/lib/generators/spree/storefront/install/templates/application.tailwind.css
index 203af7d7b1..87379637ff 100644
--- a/storefront/lib/generators/spree/storefront/install/templates/application.tailwind.css
+++ b/storefront/lib/generators/spree/storefront/install/templates/application.tailwind.css
@@ -525,6 +525,7 @@ a:hover {
.badge-ready,
.badge-partial,
.badge-active,
+.badge-balance_due,
.badge-inactive {
margin-right: 0.25rem;
display: inline-block;
@@ -548,6 +549,7 @@ a:hover {
.badge-void:last-child,
.badge-pending:last-child,
.badge-ready:last-child,
+.badge-balance_due:last-child,
.badge-partial:last-child {
margin-right: 0px;
}
@@ -560,6 +562,7 @@ a:hover {
.badge-warning,
.badge-canceled,
+.badge-balance_due,
.badge-failed {
background-color: #f8e7e5;
}