Skip to content

Commit 7d51995

Browse files
committed
refactor: update styling and layout in BountyLive component
- Enhanced avatar styling for improved visual consistency. - Adjusted layout classes for better spacing and alignment. - Updated image container to maintain aspect ratio and improve responsiveness. - Refined text elements for better readability and truncation handling.
1 parent 6c6a1dc commit 7d51995

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

lib/algora_web/live/bounty_live.ex

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ defmodule AlgoraWeb.BountyLive do
305305
<.card_content>
306306
<div class="flex flex-col sm:flex-row sm:justify-between gap-4">
307307
<div class="flex flex-col gap-4 sm:flex-row sm:items-center">
308-
<.avatar class="h-12 w-12 sm:h-20 sm:w-20 rounded-2xl">
308+
<.avatar class="h-12 w-12 sm:h-20 sm:w-20 rounded-lg sm:rounded-2xl">
309309
<.avatar_image src={@ticket.repository.user.avatar_url} />
310310
<.avatar_fallback>
311311
{Util.initials(@ticket.repository.user.provider_login)}
@@ -338,8 +338,8 @@ defmodule AlgoraWeb.BountyLive do
338338
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
339339
<.card class="flex flex-col items-between justify-center">
340340
<.card_content>
341-
<div class="flex items-center justify-between">
342-
<div>
341+
<div class="flex items-center justify-between gap-6">
342+
<div class="shrink-1">
343343
<.card_title>
344344
Share on socials
345345
</.card_title>
@@ -366,23 +366,25 @@ defmodule AlgoraWeb.BountyLive do
366366
/>
367367
</div>
368368
</div>
369-
<img
370-
src={~p"/og/0/bounties/#{@bounty.id}"}
371-
alt={@bounty.ticket.title}
372-
class="mt-3 w-full aspect-[1200/630] max-w-[11rem] rounded-lg ring-1 ring-input bg-black"
373-
/>
369+
<div class="relative aspect-[1200/630] max-w-[11rem] rounded-lg ring-1 ring-input bg-black">
370+
<img
371+
src={~p"/og/0/bounties/#{@bounty.id}"}
372+
alt={@bounty.ticket.title}
373+
class="object-cover"
374+
/>
375+
</div>
374376
</div>
375377
</.card_content>
376378
</.card>
377379
<.card class="flex flex-col items-between justify-center">
378380
<.card_content>
379-
<div class="flex items-center justify-between">
381+
<div class="flex items-center justify-between gap-2">
380382
<div>
381383
<.card_title>
382384
Exclusives
383385
</.card_title>
384386
<div class="flex items-center">
385-
<span class="text-sm text-muted-foreground">
387+
<span class="text-sm text-muted-foreground whitespace-nowrap">
386388
<%= if @bounty.deadline do %>
387389
Expires on {Calendar.strftime(@bounty.deadline, "%b %d, %Y")}
388390
<.button
@@ -420,9 +422,13 @@ defmodule AlgoraWeb.BountyLive do
420422
<.avatar_image src={user.avatar_url} />
421423
<.avatar_fallback>{Util.initials(user.name)}</.avatar_fallback>
422424
</.avatar>
423-
<div>
424-
<p class="font-medium">{user.name}</p>
425-
<p class="text-sm text-muted-foreground">@{user.provider_login}</p>
425+
<div class="max-w-[6rem] sm:max-w-none">
426+
<p class="font-medium truncate">
427+
{user.name}
428+
</p>
429+
<p class="text-sm text-muted-foreground truncate">
430+
@{user.provider_login}
431+
</p>
426432
</div>
427433
</div>
428434
</span>
@@ -749,17 +755,17 @@ defmodule AlgoraWeb.BountyLive do
749755
transition: {"transition-opacity", "opacity-0", "opacity-100"}
750756
)
751757
}
752-
class="size-9 relative cursor-pointer text-foreground/90 hover:text-foreground bg-muted"
758+
class="size-6 sm:size-9 relative cursor-pointer text-foreground/90 hover:text-foreground bg-muted"
753759
>
754760
<.icon
755761
id={@id <> "-copy-icon"}
756762
name={@icon}
757-
class="absolute inset-0 m-auto size-6 flex items-center justify-center"
763+
class="absolute inset-0 m-auto size-6 sm:size-6 flex items-center justify-center"
758764
/>
759765
<.icon
760766
id={@id <> "-check-icon"}
761767
name="tabler-check"
762-
class="absolute inset-0 m-auto hidden size-6 items-center justify-center"
768+
class="absolute inset-0 m-auto hidden size-6 sm:size-6 items-center justify-center"
763769
/>
764770
</.button>
765771
"""

0 commit comments

Comments
 (0)