Skip to content

Commit 8f948fa

Browse files
committed
refactor: update dashboard titles to use header prefix
- Modified section titles in the dashboard to include a dynamic header prefix based on organization type. - Added a new helper function `header_prefix/1` to determine the appropriate prefix for organization names.
1 parent 43eb338 commit 8f948fa

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/algora_web/live/org/dashboard_live.ex

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ defmodule AlgoraWeb.Org.DashboardLive do
250250
</.section>
251251
<.section
252252
:if={@contributors != []}
253-
title={"#{@current_org.name} Contributors"}
253+
title={"#{header_prefix(@current_org)} Contributors"}
254254
subtitle="Share bounties, tips or contract opportunities with your top contributors"
255255
>
256256
<div class="relative w-full overflow-auto max-h-[400px] scrollbar-thin">
@@ -292,7 +292,9 @@ defmodule AlgoraWeb.Org.DashboardLive do
292292
<div class="mb-2">
293293
<div class="flex flex-wrap items-start justify-between gap-4 lg:flex-nowrap">
294294
<div>
295-
<h2 class="text-2xl font-bold dark:text-white">{@current_org.name} Bounties</h2>
295+
<h2 class="text-2xl font-bold dark:text-white">
296+
{header_prefix(@current_org)} Bounties
297+
</h2>
296298
<p class="text-sm dark:text-gray-300">
297299
Create new bounties by commenting
298300
<code class="mx-1 inline-block rounded bg-emerald-950/75 px-1 py-0.5 font-mono text-sm text-emerald-400 ring-1 ring-emerald-400/25">
@@ -460,7 +462,7 @@ defmodule AlgoraWeb.Org.DashboardLive do
460462
</div>
461463
462464
<.section
463-
title={"#{@current_org.name} Ecosystem"}
465+
title={"#{header_prefix(@current_org)} Ecosystem"}
464466
subtitle="Help maintain and grow your ecosystem by creating bounties and tips in your dependencies"
465467
>
466468
<div class="pt-8 flex flex-col gap-8">
@@ -1847,4 +1849,11 @@ defmodule AlgoraWeb.Org.DashboardLive do
18471849
</.drawer>
18481850
"""
18491851
end
1852+
1853+
defp header_prefix(current_org) do
1854+
case current_org.type do
1855+
:organization -> current_org.name
1856+
_ -> "Your"
1857+
end
1858+
end
18501859
end

0 commit comments

Comments
 (0)