|
| 1 | +defmodule AlgoraWeb.OG.BountyLive do |
| 2 | + @moduledoc false |
| 3 | + use AlgoraWeb, :live_view |
| 4 | + |
| 5 | + alias Algora.Bounties |
| 6 | + |
| 7 | + def mount(%{"id" => id}, _session, socket) do |
| 8 | + case Bounties.list_bounties(id: id) do |
| 9 | + [bounty | _] -> |
| 10 | + socket = |
| 11 | + socket |
| 12 | + |> assign(:bounty, bounty) |
| 13 | + |> assign(:ticket, bounty.ticket) |
| 14 | + |
| 15 | + {:ok, socket} |
| 16 | + |
| 17 | + [] -> |
| 18 | + {:ok, socket |> put_flash(:error, "Bounty not found") |> redirect(to: "/")} |
| 19 | + end |
| 20 | + end |
| 21 | + |
| 22 | + def render(assigns) do |
| 23 | + ~H""" |
| 24 | + <div class="relative flex h-[630px] w-[1200px] flex-col bg-[#0A0A0A] p-8 border-l-[1rem] border-emerald-400"> |
| 25 | + <div class="absolute left-[3rem] top-8 text-2xl font-display font-medium text-muted-foreground"> |
| 26 | + algora.io |
| 27 | + </div> |
| 28 | + <div class="absolute right-8 top-8 font-display text-2xl font-medium text-muted-foreground"> |
| 29 | + {@bounty.repository.name}#{@ticket.number} |
| 30 | + </div> |
| 31 | + <div class="flex flex-col items-center text-center"> |
| 32 | + <div class="relative"> |
| 33 | + <img |
| 34 | + src={@bounty.owner.avatar_url} |
| 35 | + class="relative h-40 w-40 rounded-full bg-black" |
| 36 | + alt="Algora" |
| 37 | + /> |
| 38 | + </div> |
| 39 | + <div class="mt-4 flex flex-col items-center font-display"> |
| 40 | + <p class="text-7xl font-semibold text-foreground"> |
| 41 | + {@bounty.owner.name} |
| 42 | + </p> |
| 43 | + <h1 class="mt-4 text-8xl font-extrabold tracking-tight text-white"> |
| 44 | + <span class="text-emerald-400"> |
| 45 | + {Money.to_string!(@bounty.amount, no_fraction_if_integer: true)} |
| 46 | + </span> |
| 47 | + Bounty |
| 48 | + </h1> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | +
|
| 52 | + <h2 class="mt-12 text-center text-4xl font-semibold text-foreground/90 line-clamp-3 leading-[3.5rem]"> |
| 53 | + {@ticket.title} |
| 54 | + </h2> |
| 55 | + <%!-- <div class="mt-auto flex items-center justify-between"> |
| 56 | + <div class="flex items-center gap-3"> |
| 57 | + <div class="text-xl font-medium text-emerald-300"> |
| 58 | + algora.io |
| 59 | + </div> |
| 60 | + <div class="h-2 w-2 rounded-full bg-muted-foreground"></div> |
| 61 | + <div class="text-xl font-medium text-muted-foreground"> |
| 62 | + Earn bounties for open source contributions |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + </div> --%> |
| 66 | + </div> |
| 67 | + """ |
| 68 | + end |
| 69 | +end |
0 commit comments