Skip to content

Commit

Permalink
Add an "Add Product" button to the products/index component
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Jul 20, 2023
1 parent b7bfa7a commit e59b732
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<div class="<%= stimulus_id %>">
<header class="mb-6">
<div class="<%= stimulus_id %> px-4">
<header class="py-6 flex items-center">
<h1 class="body-title">
<%= Spree::Product.model_name.human.pluralize %>
</h1>

<div class="ml-auto">
<%= render component("ui/button").new(
tag: :a,
text: t('.add_product'),
href: spree.new_admin_product_path,
icon: "plus-line",
classes: "ml-auto"
) %>
</div>
</header>

<%= render component("ui/table").new(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
en:
product_image: 'Image'
add_product: 'Add Product'
status:
available: 'Available'
discontinued: 'Discontinued'
Expand Down

0 comments on commit e59b732

Please sign in to comment.