Skip to content

Commit

Permalink
Refactor media_badges component in
Browse files Browse the repository at this point in the history
PlatformWeb.Components and SearchComponent
  • Loading branch information
milesmcc committed Nov 20, 2023
1 parent 859d3b6 commit fcbbcf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions platform/lib/platform_web/components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -588,13 +588,13 @@ defmodule PlatformWeb.Components do
<%= Media.slug_to_display(@media) %>
</div>
<p class="md:hidden flex items-center flex-shrink-0 text-xs items-center flex-shrink-1 gap-1 justify-right">
<.media_badges media={@media} only_status={true} />
<.media_badges media={@media} />
</p>
<p class="font-medium flex-grow-1 flex items-center max-w-full gap-2 grow truncate min-w-0">
<span class="truncate"><%= @media.attr_description |> Platform.Utils.truncate(128) %></span>
</p>
<p class="hidden md:block flex items-center flex-shrink-0 text-xs items-center flex-shrink-1 gap-1 justify-right">
<.media_badges media={@media} only_status={true} />
<.media_badges media={@media} />
</p>
</article>
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ defmodule PlatformWeb.SearchLive.SearchComponent do
<.link navigate={"/incidents/#{item.slug}"} class="cursor-pointer">
<li
id={item.id}
class="group flex transition rounded mx-2 ease-in-out duration-100 select-none items-center px-2 py-2"
class="group flex transition rounded mx-2 ease-in-out duration-100 items-center px-2 py-2"
x-bind:class={"#{idx} === (selected % #{@total_results}) ? 'bg-neutral-200' : 'bg-white'"}
x-on:mouseenter={"if (new Date().getTime() - lastKeyChangeTime > 500) { selected = #{idx} }"}
role="option"
Expand Down

0 comments on commit fcbbcf8

Please sign in to comment.