Skip to content

Commit ce8ec94

Browse files
committed
Add links to example searches
1 parent 43f7cc9 commit ce8ec94

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

apps/components_guide_web/assets/css/app.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ article a:hover {
2121
font-weight: bold;
2222
}
2323

24+
a {
25+
padding: var(--links-padding);
26+
}
27+
2428
input {
2529
outline: none;
2630
}

apps/components_guide_web/lib/components_guide_web/controllers/research_controller.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ defmodule ComponentsGuideWeb.ResearchController do
3939
defp load_results(query) when is_binary(query) do
4040
# Spec.clear_search_cache()
4141
[
42-
content_tag(:article, [
43-
h2("HTML spec"),
44-
Spec.search_for(:whatwg_html_spec, query) |> present_results()
45-
]),
4642
content_tag(:article, [
4743
h2("Can I Use"),
4844
Spec.search_for(:caniuse, query) |> present_results()
4945
]),
46+
content_tag(:article, [
47+
h2("HTML spec"),
48+
Spec.search_for(:whatwg_html_spec, query) |> present_results()
49+
]),
5050
content_tag(:article, [
5151
h2("HTML ARIA"),
5252
Spec.search_for(:html_aria_spec, query) |> present_results()

apps/components_guide_web/lib/components_guide_web/templates/research/index.html.eex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
<form role=search action="/research" class="flex h-full pt-8 px-2 items-center">
77
<input type=text name=q placeholder="Search" class="w-full py-1 px-2 bg-white text-black text-xl" value="<%= @query %>">
88
</form>
9+
<ul class="list-none flex pt-4" style="--links-padding: 1em">
10+
<li><%= link("form", to: "?q=form") %>
11+
<li><%= link("button", to: "?q=button") %>
12+
<li><%= link("transition", to: "?q=transition") %>
13+
</ul>
914
</section>
1015
</header>
1116

1217
<div class="bg-white py-16">
1318
<div class="container px-6">
14-
<h1>
15-
Results for
16-
<strong><%= @query %></strong>:
17-
</h1>
18-
<%#= raw @results %>
1919
<%= @results %>
2020
</div>
2121
</div>

0 commit comments

Comments
 (0)