Skip to content

Commit 0fa2ae5

Browse files
PatStilesuri-99MarcosNicolau
authored
feat(explorer): Fix nav bar (#1660)
Co-authored-by: Urix <[email protected]> Co-authored-by: Marcos Nicolau <[email protected]>
1 parent fcf9035 commit 0fa2ae5

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

explorer/lib/explorer_web/components/nav.ex

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,22 @@ defmodule NavComponent do
3131
~H"""
3232
<nav class={
3333
classes([
34-
"px-4 sm:px-6 lg:px-8 fixed top-0 p-3 z-50",
35-
"flex justify-between items-center w-full",
34+
"flex fixed justify-center items-center w-full",
3635
"border-b border-foreground/10 backdrop-blur-lg backdrop-saturate-200"
3736
])
38-
}>
39-
<div class="gap-x-6 inline-flex">
37+
}
38+
style="z-index: 1"
39+
>
40+
<div class={classes(["gap-5 lg:gap-10 px-4 sm:px-6 lg:px-8 top-0 p-3 z-50",
41+
"flex justify-between items-center w-full"])} style="max-width: 1200px;">
42+
<div class="gap-x-6 flex">
4043
<.link
4144
class="hover:scale-105 transform duration-150 active:scale-95 text-3xl"
4245
navigate={~p"/"}
4346
>
4447
🟩 <span class="sr-only">Aligned Explorer Home</span>
4548
</.link>
46-
<div class={["items-center gap-8 [&>a]:drop-shadow-md", "hidden md:inline-flex"]}>
49+
<div class={["items-center gap-5 hidden md:inline-flex"]}>
4750
<.link
4851
class={
4952
active_view_class(assigns.socket.view, [
@@ -78,9 +81,11 @@ defmodule NavComponent do
7881
Restakes
7982
</.link>
8083
</div>
84+
</div>
85+
<div style="max-width: 600px; width: 100%;">
8186
<.live_component module={SearchComponent} id="nav_search" />
8287
</div>
83-
<div class="items-center gap-4 font-semibold leading-6 text-foreground/80 flex [&>a]:hidden lg:[&>a]:inline-block [&>a]:drop-shadow-md">
88+
<div class="items-center gap-4 font-semibold leading-6 text-foreground/80 flex [&>a]:hidden lg:[&>a]:inline-block">
8489
<.link class="hover:text-foreground" target="_blank" href="https://docs.alignedlayer.com">
8590
Docs
8691
</.link>
@@ -92,15 +97,9 @@ defmodule NavComponent do
9297
GitHub
9398
</.link>
9499
<DarkMode.button />
95-
<.badge :if={@latest_release != nil} class="hidden md:inline">
96-
<%= @latest_release %>
97-
<.tooltip>
98-
Latest Aligned version
99-
</.tooltip>
100-
</.badge>
101100
<.hover_dropdown_selector
102101
current_value={get_current_network(@host)}
103-
variant="foreground"
102+
variant="accent"
104103
options={@networks}
105104
icon="hero-cube-transparent-micro"
106105
/>
@@ -171,6 +170,7 @@ defmodule NavComponent do
171170
</div>
172171
</div>
173172
</div>
173+
</div>
174174
</nav>
175175
"""
176176
end

explorer/lib/explorer_web/components/search.ex

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ defmodule SearchComponent do
2222
end
2323
end
2424

25-
attr :class, :string, default: nil
25+
attr(:class, :string, default: nil)
2626

2727
@impl true
2828
def render(assigns) do
@@ -32,26 +32,20 @@ defmodule SearchComponent do
3232
phx-submit="search_batch"
3333
class={
3434
classes([
35-
"relative flex items-center gap-2 z-10 px-5 sm:px-0 drop-shadow-sm max-w-md",
35+
"relative flex items-center gap-2 sm:px-0 w-full",
3636
@class
3737
])
3838
}
3939
>
4040
<input
4141
phx-hook="SearchFocus"
4242
id={"input_#{assigns.id}"}
43-
class="pr-10 shadow-md flex h-10 w-full lg:min-w-80 file:border-0 text-foreground file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed flex-1 rounded-md border border-foreground/20 bg-card px-4 py-2 text-sm font-medium transition-colors hover:bg-muted focus:outline-none focus:ring-1 disabled:pointer-events-none disabled:opacity-50 hover:text-foreground"
43+
class="pr-10 w-full rounded-lg border-foreground/20 bg-card focus:border-foreground/20 focus:ring-accent text-sm"
4444
type="search"
45-
placeholder="Enter batch or proof hash (cmd+K)"
45+
placeholder="Search by batch hash, proof hash, address"
4646
name="batch[merkle_root]"
4747
/>
48-
<.button
49-
type="submit"
50-
class="absolute right-5 sm:right-1 top-0.5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-transparent border-none size-10 shadow-none hover:bg-transparent text-muted-foreground"
51-
>
52-
<.icon name="hero-magnifying-glass-solid" class="size-5 hover:text-foreground" />
53-
<span class="sr-only">Search</span>
54-
</.button>
48+
<.icon name="hero-magnifying-glass-solid" class="absolute right-3 text-foreground/20 size-5 hover:text-foreground" />
5549
</form>
5650
"""
5751
end

0 commit comments

Comments
 (0)