Skip to content

Commit 87b2e2f

Browse files
committed
Rename panel to menu
1 parent c0536f3 commit 87b2e2f

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

lib/plausible_web/components/generic.ex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,25 +227,25 @@ defmodule PlausibleWeb.Components.Generic do
227227
attr(:class, :string)
228228
end
229229

230-
slot :panel, required: true do
230+
slot :menu, required: true do
231231
attr(:class, :string)
232232
end
233233

234234
def dropdown(assigns) do
235-
assigns = assign(assigns, :panel_class, assigns.panel |> List.first() |> Map.get(:class, ""))
235+
assigns = assign(assigns, :menu_class, assigns.menu |> List.first() |> Map.get(:class, ""))
236236

237237
~H"""
238238
<div
239239
x-data="dropdown"
240240
x-on:keydown.escape.prevent.stop="close($refs.button)"
241-
x-on:focusin.window="!$refs.panel.contains($event.target) && close()"
241+
x-on:focusin.window="!$refs.menu.contains($event.target) && close()"
242242
class="relative inline-block text-left"
243243
>
244244
<button x-ref="button" x-on:click="toggle()" type="button" class={List.first(@button).class}>
245245
<%= render_slot(List.first(@button)) %>
246246
</button>
247247
<div
248-
x-ref="panel"
248+
x-ref="menu"
249249
x-show="open"
250250
x-transition:enter="transition ease-out duration-100"
251251
x-transition:enter-start="opacity-0 scale-95"
@@ -257,10 +257,10 @@ defmodule PlausibleWeb.Components.Generic do
257257
style="display: none;"
258258
class={[
259259
"origin-top-right absolute z-50 right-0 mt-2 p-1 w-max rounded-md shadow-lg overflow-hidden bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5 focus:outline-none",
260-
@panel_class
260+
@menu_class
261261
]}
262262
>
263-
<%= render_slot(List.first(@panel)) %>
263+
<%= render_slot(List.first(@menu)) %>
264264
</div>
265265
</div>
266266
"""

lib/plausible_web/live/sites.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ defmodule PlausibleWeb.Live.Sites do
233233
<:button class="size-10 rounded-md hover:cursor-pointer text-gray-400 dark:text-gray-600 hover:text-black dark:hover:text-indigo-400">
234234
<Heroicons.ellipsis_vertical class="absolute top-3 right-3 size-4" />
235235
</:button>
236-
<:panel class="!mt-0 mr-4 min-w-40">
236+
<:menu class="!mt-0 mr-4 min-w-40">
237237
<!-- adjust position because click area is much bigger than icon. Default positioning from click area looks weird -->
238238
<.dropdown_item
239239
:if={List.first(@site.memberships).role != :viewer}
@@ -267,7 +267,7 @@ defmodule PlausibleWeb.Live.Sites do
267267
<.icon_pin :if={!@site.pinned_at} class="size-4" />
268268
<span :if={!@site.pinned_at}>Pin Site</span>
269269
</.dropdown_item>
270-
</:panel>
270+
</:menu>
271271
</.dropdown>
272272
"""
273273
end

lib/plausible_web/templates/layout/_header.html.heex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
class="w-7 rounded-full"
6666
/>
6767
</:button>
68-
<:panel>
68+
<:menu>
6969
<.dropdown_item>
7070
<div class="text-xs text-gray-500 dark:text-gray-400">Signed in as</div>
7171
<p class="truncate font-medium text-gray-900 dark:text-gray-100" role="none">
@@ -90,7 +90,7 @@
9090
</.dropdown_item>
9191
<.dropdown_divider />
9292
<.dropdown_item href="/logout">Log Out</.dropdown_item>
93-
</:panel>
93+
</:menu>
9494
</.dropdown>
9595
</li>
9696
<%= if @conn.assigns[:current_user] && ee?() do %>

lib/plausible_web/templates/site/settings_people.html.heex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<%= membership.role |> to_string() |> String.capitalize() %>
4848
<Heroicons.chevron_down mini class="size-4 mt-0.5" />
4949
</:button>
50-
<:panel class="max-w-60">
50+
<:menu class="max-w-60">
5151
<%= if membership.role == :owner do %>
5252
<.dropdown_item disabled={true}>
5353
<div>Owner</div>
@@ -118,7 +118,7 @@
118118
Remove member
119119
</.dropdown_item>
120120
<% end %>
121-
</:panel>
121+
</:menu>
122122
</.dropdown>
123123
</div>
124124
</li>

0 commit comments

Comments
 (0)