Skip to content

Commit 23ec178

Browse files
committed
feat: announcement banner
1 parent eddbb05 commit 23ec178

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
defmodule AlgoraWeb.Components.Banner do
2+
@moduledoc false
3+
use AlgoraWeb.Component
4+
use AlgoraWeb, :verified_routes
5+
6+
import AlgoraWeb.CoreComponents
7+
8+
alias AlgoraWeb.Constants
9+
10+
def banner(assigns) do
11+
~H"""
12+
<div class="group flex items-center gap-x-6 bg-emerald-600 px-6 py-2.5 sm:px-3.5 sm:before:flex-1">
13+
<p class="text-sm/6 text-foreground">
14+
<.link
15+
href={Constants.get(:github_repo_url)}
16+
rel="noopener"
17+
target="_blank"
18+
class="font-medium"
19+
>
20+
<strong class="font-semibold">🎉 Algora is now open source!</strong><svg
21+
viewBox="0 0 2 2"
22+
class="mx-2 inline size-1 fill-current"
23+
aria-hidden="true"
24+
><circle cx="1" cy="1" r="1" /></svg>Give us a star
25+
<.icon
26+
name="tabler-arrow-right"
27+
class="size-4 group-hover:translate-x-1.5 transition-transform"
28+
/>
29+
</.link>
30+
</p>
31+
<div class="flex flex-1 justify-end">
32+
<%!-- <button type="button" class="-m-3 p-3 focus-visible:outline-offset-[-4px]">
33+
<span class="sr-only">Dismiss</span>
34+
<svg
35+
class="size-5 text-white"
36+
viewBox="0 0 20 20"
37+
fill="currentColor"
38+
aria-hidden="true"
39+
data-slot="icon"
40+
>
41+
<path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" />
42+
</svg>
43+
</button> --%>
44+
</div>
45+
</div>
46+
"""
47+
end
48+
end

lib/algora_web/components/header.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ defmodule AlgoraWeb.Components.Header do
1818
def header(assigns) do
1919
~H"""
2020
<header class="absolute inset-x-0 top-0 z-50">
21-
<nav class="mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8" aria-label="Global">
21+
<AlgoraWeb.Components.Banner.banner />
22+
23+
<nav
24+
class="-mt-4 mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8"
25+
aria-label="Global"
26+
>
2227
<div class="flex lg:flex-1">
2328
<.wordmark class="h-8 w-auto text-foreground" />
2429
</div>

lib/algora_web/components/layouts/user.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
</div>
346346
</div>
347347

348-
<div :if={!@current_user && !assigns[:screenshot?]} class="relative pt-16">
348+
<div :if={!@current_user && !assigns[:screenshot?]} class="relative pt-24">
349349
<.flash_group flash={@flash} />
350350
<AlgoraWeb.Components.Header.header />
351351
{@inner_content}

0 commit comments

Comments
 (0)