Improve moderation tabs on mobile
This commit is contained in:
parent
87d6b94bf7
commit
0975b5dec8
|
|
@ -490,6 +490,7 @@ defmodule WhoNeedHelpWeb.ModerationLive do
|
|||
active={@active_queue == :proposals}
|
||||
patch={~p"/moderation?queue=proposals"}
|
||||
icon="hero-tag"
|
||||
compact_label={gettext("Categories")}
|
||||
>
|
||||
{gettext("Category proposals")}
|
||||
</.queue_link>
|
||||
|
|
@ -578,6 +579,7 @@ defmodule WhoNeedHelpWeb.ModerationLive do
|
|||
attr :active, :boolean, required: true
|
||||
attr :patch, :string, required: true
|
||||
attr :icon, :string, required: true
|
||||
attr :compact_label, :string, default: nil
|
||||
slot :inner_block, required: true
|
||||
|
||||
defp queue_link(assigns) do
|
||||
|
|
@ -591,7 +593,11 @@ defmodule WhoNeedHelpWeb.ModerationLive do
|
|||
]}
|
||||
>
|
||||
<.icon name={@icon} class="hidden size-4 shrink-0 sm:block" />
|
||||
<span class="truncate">{render_slot(@inner_block)}</span>
|
||||
<span :if={@compact_label} class="sm:hidden">{@compact_label}</span>
|
||||
<span :if={@compact_label} class="hidden truncate sm:inline">
|
||||
{render_slot(@inner_block)}
|
||||
</span>
|
||||
<span :if={!@compact_label} class="truncate">{render_slot(@inner_block)}</span>
|
||||
</.link>
|
||||
"""
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1567,6 +1567,13 @@ defmodule WhoNeedHelpWeb.MutualAidLiveTest do
|
|||
assert html =~ "Reports"
|
||||
assert html =~ "Abuse signals"
|
||||
assert html =~ "Category proposals"
|
||||
|
||||
assert has_element?(
|
||||
view,
|
||||
"nav[aria-label='Trust and safety queues'] .sm\\:hidden",
|
||||
"Categories"
|
||||
)
|
||||
|
||||
refute html =~ "Users & roles"
|
||||
assert html =~ "Please review the matched conversation."
|
||||
refute has_element?(view, "#moderation-user-status-#{user.id}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user