Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Sep 12, 2023
1 parent 5d2dece commit 37a50d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
13 changes: 4 additions & 9 deletions example-templates/dist/shop/_private/address/list.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
{% if currentUser %}
{% if addresses|length %}
<div class="my-6 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-4">
<a href="{{ url('/shop/customer/addresses/edit') }}" class="block rounded-lg hover:shadow-md w-full">
{% if showAdd %}
<a href="{{ addUrl }}" class="block rounded-lg hover:shadow-md w-full">
<div class="flex items-center justify-center h-full border border-gray-200 bg-white rounded-lg shadow-sm p-4 w-full group hover:shadow-md">
<span class="group-hover:underline">Add Address</span>
</div>
</a>
{% endif %}
{% for address in addresses %}
{% set editUrl = '/shop/customer/addresses/edit?addressId=' ~ address.id ~ '&redirect=' ~ craft.app.request.fullPath %}
<div class="block border border-gray-200 bg-white rounded-lg shadow-sm hover:shadow-md p-4 w-full">
Expand All @@ -32,7 +34,7 @@
checked: (attribute(cart, sourceIdName) == address.id) or (not attribute(cart, sourceIdName) and address.id == attribute(_context, primaryIdName)),
}) }}
{% endif %}
<span class="-mt-2 mb-2">
<span class="-mt-2 mb-2 {% if selectable %}ml-4{% endif %}">
{{ address|address }}
</span>
</span>
Expand All @@ -59,13 +61,6 @@
{% endfor %}
</div>
{% endif %}
{% if showAdd %}
<div class="pt-2">
<a href="{{ url(addUrl) }}" class="inline-block bg-blue-500 text-white rounded-md py-2 px-4 hover:bg-blue-600">
{{ 'Add address'|t }}
</a>
</div>
{% endif %}
{% endif %}

{% js %}
Expand Down
1 change: 1 addition & 0 deletions example-templates/dist/shop/customer/addresses/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
primaryShippingAddressId: currentUser.primaryShippingAddressId,
cardWidth: 'md:w-1/3',
showDelete: true,
showAdd: true
}) }}
{% else %}
<div class="mt-10">
Expand Down
13 changes: 4 additions & 9 deletions example-templates/src/shop/_private/address/list.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
{% if currentUser %}
{% if addresses|length %}
<div class="my-6 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-4">
<a href="{{ url('/[[folderName]]/customer/addresses/edit') }}" class="block rounded-lg hover:shadow-md w-full">
{% if showAdd %}
<a href="{{ addUrl }}" class="block rounded-lg hover:shadow-md w-full">
<div class="flex items-center justify-center h-full border border-gray-200 bg-white rounded-lg shadow-sm p-4 w-full group hover:shadow-md">
<span class="group-hover:underline">Add Address</span>
</div>
</a>
{% endif %}
{% for address in addresses %}
{% set editUrl = '/[[folderName]]/customer/addresses/edit?addressId=' ~ address.id ~ '&redirect=' ~ craft.app.request.fullPath %}
<div class="block border border-gray-200 bg-white rounded-lg shadow-sm hover:shadow-md p-4 w-full">
Expand All @@ -32,7 +34,7 @@
checked: (attribute(cart, sourceIdName) == address.id) or (not attribute(cart, sourceIdName) and address.id == attribute(_context, primaryIdName)),
}) }}
{% endif %}
<span class="-mt-2 mb-2">
<span class="-mt-2 mb-2 {% if selectable %}ml-4{% endif %}">
{{ address|address }}
</span>
</span>
Expand All @@ -59,13 +61,6 @@
{% endfor %}
</div>
{% endif %}
{% if showAdd %}
<div class="pt-2">
<a href="{{ url(addUrl) }}" class="inline-block bg-blue-500 text-white rounded-md py-2 px-4 hover:bg-blue-600">
{{ 'Add address'|t }}
</a>
</div>
{% endif %}
{% endif %}

{% js %}
Expand Down
1 change: 1 addition & 0 deletions example-templates/src/shop/customer/addresses/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
primaryShippingAddressId: currentUser.primaryShippingAddressId,
cardWidth: 'md:w-1/3',
showDelete: true,
showAdd: true
}) }}
{% else %}
<div class="mt-10">
Expand Down

0 comments on commit 37a50d0

Please sign in to comment.