Skip to content

Commit

Permalink
feat(embeds): add copy button to embed drawer toolbar
Browse files Browse the repository at this point in the history
re #490
  • Loading branch information
allmarkedup committed Jul 20, 2023
1 parent 3cf3b25 commit aa0da37
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/components/lookbook/embed/inspector/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@
<% end %>
<% end %>
<% end %>

<% toolbar.with_section align: :right, class: "flex-none relative z-10" do %>
<%= lookbook_render :button_group do |group| %>
<%= panels.select { |p| !p.disabled && p.copy }.each do |panel| %>
<% group.with_button id: "copy-panel-contents-button-#{panel.name}",
icon: :copy,
tooltip: "Copy panel contents",
copy: !!panel.copy,
"x-show": "store.activeTab === '#{panel.name}'",
cloak: true do %>
<%= panel.copy ? panel.copy : "" %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>

<div class="bg-lookbook-drawer-bg">
Expand Down

0 comments on commit aa0da37

Please sign in to comment.