Skip to content

Commit dc2f615

Browse files
authored
Merge pull request #231 from ecosyste-ms/add-search-to-home
Add search bar to homepage
2 parents e9c4971 + 04bded5 commit dc2f615

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

app/assets/stylesheets/application.scss

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,28 @@
164164
color: $color-white;
165165
padding: 0.25rem 0.5rem;
166166
}
167+
168+
.home-search {
169+
background-color: $color-grey-light;
170+
z-index: 100;
171+
position: relative;
172+
.container {
173+
174+
}
175+
h2 {
176+
@include media-breakpoint-up(md) {
177+
text-align: right;
178+
}
179+
}
180+
form {
181+
max-width: 455px;
182+
}
183+
}
184+
185+
.home-search__wrapper {
186+
187+
@include media-breakpoint-up(md) {
188+
display: flex;
189+
justify-content: center;
190+
}
191+
}

app/views/funds/index.html.erb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,25 @@
6363
</div>
6464
</div>
6565
</div>
66+
<div class="home-search py-5">
67+
<div class="container text-center">
68+
<div class="row">
69+
<div class="home-search__wrapper">
70+
71+
<h2 class="h1 extra-bold mb-4 me-3 mt-3">Find a fund</h2>
72+
73+
<%= form_tag search_funds_path, method: :get, class: "mb-4 mt-3" do %>
74+
<label for="query" class="ps-3 mb-2 visually-hidden">Fund name</label>
75+
<div class="input-group rounded-input-group">
76+
<%= text_field_tag :query, params[:query], class: "form-control form-control-lg", placeholder: "eg. Django" %>
77+
<button type="submit" class="btn btn-lg btn-danger pe-4">Search</button>
78+
</div>
79+
</div>
80+
</div>
81+
</div>
82+
</div>
83+
84+
<% end %>
6685
<div class="container">
6786

6887
<div class="row my-5">

0 commit comments

Comments
 (0)