Skip to content

Commit 3af6634

Browse files
committed
Change search form to have a searchbox
1 parent 64751d3 commit 3af6634

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

lib/components_guide_web/templates/accessibility_first/_nav.html.eex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<li><%= link("Forms", to: '/accessibility-first/forms') %>
88
<li><%= link("All Roles", to: '/accessibility-first/roles') %>
99
<li><%= link("Accessible Name", to: '/accessibility-first/accessible-name') %>
10+
<li><%= link("Snapshots", to: '/accessibility-first/accessibility-tree-snapshots') %>
1011
<li><%= link("Properties", to: '/accessibility-first/properties-cheatsheet') %>
1112
<li><%= link("Widgets", to: '/accessibility-first/widgets-cheatsheet') %>
1213
</ul>

lib/components_guide_web/templates/layout/_banner.html.eex renamed to lib/components_guide_web/templates/layout/_banner.html.heex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<header role=banner class="bg-gray-900 text-white">
1+
<header role="banner" class="bg-gray-900 text-white">
22
<nav role="navigation" aria-label="Primary" class="w-full flex items-center lg:px-16 text-base text-center">
33
<details class="relative" data-links="block p-3 underline-on-hover">
44
<summary class="block w-48 text-left pl-6 text-base uppercase font-bold tracking-wider">
@@ -23,7 +23,7 @@
2323
<hr class="mx-auto">
2424

2525
<div class="w-48 pr-6">
26-
<%= search_form() %>
26+
<.search_form></.search_form>
2727
</div>
2828
</nav>
2929
</header>

lib/components_guide_web/views/layout_view.ex

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,26 @@ defmodule ComponentsGuideWeb.LayoutView do
1414
# {"About", to: "/about"}
1515
]
1616

17-
def search_form do
18-
~E"""
19-
<form role=search action="/research" class="flex h-full px-2 items-center">
20-
<input type=text name=q placeholder="Search…" class="w-full py-1 px-4 text-sm bg-gray-800 text-white rounded-full border border-gray-600">
17+
def search_form(assigns) do
18+
~H"""
19+
<form role="search" action="/research" class="flex h-full px-2 items-center">
20+
<input type="search" name="q" placeholder="Search…" class="w-full py-1 px-4 text-sm bg-gray-800 text-white rounded-full border border-gray-600">
2121
</form>
2222
"""
2323
end
2424

25-
def search_form_item do
26-
~E"""
27-
<li class=row-span-3>
28-
<%= search_form() %>
25+
def search_form_item(assigns) do
26+
~H"""
27+
<li class="row-span-3">
28+
<%= search_form([]) %>
29+
</li>
2930
"""
3031
end
3132

3233
def nav_items(path_info) do
3334
[
3435
Enum.map(@nav_links, fn
35-
{:search} -> search_form_item()
36+
{:search} -> search_form_item([])
3637
{title, to: to} -> nav_link_item(title: title, to: to, path_info: path_info)
3738
end)
3839
]

0 commit comments

Comments
 (0)