Skip to content

Commit 8cd676e

Browse files
committed
conditionally render
1 parent 4b47526 commit 8cd676e

File tree

1 file changed

+33
-27
lines changed

1 file changed

+33
-27
lines changed

lib/algora_web/live/org/job_live.ex

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,15 @@ defmodule AlgoraWeb.Org.JobLive do
403403
<br class="md:hidden" /> using contracts and bounties
404404
</span>
405405
</li>
406+
<li class="flex items-center gap-4 md:gap-3">
407+
<div class="shrink-0 flex items-center justify-center rounded-full bg-success-300/10 size-12 md:size-10 border border-success-300/20">
408+
<.icon name="tabler-moneybag" class="size-8 md:size-6 text-success-300" />
409+
</div>
410+
<span>
411+
<span class="font-semibold text-success-300">0% placement fee</span>
412+
<br class="md:hidden" /> for successful hires
413+
</span>
414+
</li>
406415
</ul>
407416
</div>
408417
<div class="flex flex-col justify-center items-center text-center">
@@ -1645,20 +1654,18 @@ defmodule AlgoraWeb.Org.JobLive do
16451654
</span>
16461655
</div>
16471656
1648-
<div class="flex justify-between items-center">
1649-
<span class="text-sm text-muted-foreground">
1650-
Early Believer Discount:
1651-
</span>
1652-
<span class="font-semibold font-display -ml-1.5">
1653-
-{Money.to_string!(
1654-
Money.sub!(
1655-
price(),
1656-
@current_org.subscription_price
1657-
)
1658-
)}
1659-
</span>
1660-
</div>
1661-
1657+
<%= if discount = Money.sub!(price(), @current_org.subscription_price) do %>
1658+
<%= if Money.positive?(discount) do %>
1659+
<div class="flex justify-between items-center">
1660+
<span class="text-sm text-muted-foreground">
1661+
Early Believer Discount:
1662+
</span>
1663+
<span class="font-semibold font-display -ml-1.5">
1664+
-{Money.to_string!(discount)}
1665+
</span>
1666+
</div>
1667+
<% end %>
1668+
<% end %>
16621669
<div class="flex justify-between items-center">
16631670
<span class="text-sm text-muted-foreground">Processing Fee (4%)</span>
16641671
<span class="font-semibold font-display">
@@ -1765,19 +1772,18 @@ defmodule AlgoraWeb.Org.JobLive do
17651772
{Money.to_string!(price())}
17661773
</span>
17671774
1768-
<span class="text-muted-foreground block">
1769-
Early Believer Discount
1770-
</span>
1771-
<span class="font-medium font-display flex">
1772-
<span class="-ml-1.5">
1773-
-{Money.to_string!(
1774-
Money.sub!(
1775-
price(),
1776-
@current_org.subscription_price
1777-
)
1778-
)}
1779-
</span>
1780-
</span>
1775+
<%= if discount = Money.sub!(price(), @current_org.subscription_price) do %>
1776+
<%= if Money.positive?(discount) do %>
1777+
<span class="text-muted-foreground block">
1778+
Early Believer Discount
1779+
</span>
1780+
<span class="font-medium font-display flex">
1781+
<span class="-ml-1.5">
1782+
-{Money.to_string!(discount)}
1783+
</span>
1784+
</span>
1785+
<% end %>
1786+
<% end %>
17811787
17821788
<span class="text-muted-foreground line-through block">
17831789
Stripe Processing Fee

0 commit comments

Comments
 (0)