Skip to content

Commit

Permalink
chore: better way to keep state consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
MelchiorKokernoot committed Nov 7, 2024
1 parent ea0a3c2 commit f0f3651
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/frameworks/pixel/components/clickable_card.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ defmodule Frameworks.Pixel.ClickableCard do
<div
x-data="{show_actions: false}"
class={"h-full rounded-lg bg-#{@bg_color} #{@size}"}
id={"card-#{@id}"}
>
<div class="flex flex-col h-full">
<div class="flex-grow">
Expand Down Expand Up @@ -68,13 +69,13 @@ defmodule Frameworks.Pixel.ClickableCard do
/>
</div>
<%= for button <- @left_actions do %>
<div x-show="show_actions" x-on:click="show_actions = false">
<div x-show="show_actions">
<Button.dynamic {button} />
</div>
<% end %>
<div class="flex-grow" />
<%= for button <- @right_actions do %>
<div x-show="show_actions" x-on:click="show_actions = false">
<div x-show="show_actions">
<Button.dynamic {button} />
</div>
<% end %>
Expand Down

0 comments on commit f0f3651

Please sign in to comment.