Skip to content

Commit c1bb7dd

Browse files
committed
feat: Add "Open Guide" buttons to <search-results>
Upon clicking, this button emits a `guide-open` event with the guide ID as the argument.
1 parent 3923448 commit c1bb7dd

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

css/search-results.css

+15
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@
3636
padding: 0 0.5em;
3737
}
3838

39+
.search-result-item__open-button {
40+
align-self: flex-start;
41+
background: none;
42+
border: 1px solid transparent;
43+
border-radius: 0.5rem;
44+
cursor: pointer;
45+
font-size: 1.5rem;
46+
margin-left: auto; /* Push the button to the right end */
47+
}
48+
49+
.search-result-item__open-button:hover {
50+
background-color: #fff;
51+
border-color: black;
52+
}
53+
3954
.search-result-item__tier--type-iron {
4055
background-color: var(--tier-bgcolor-iron);
4156
color: var(--tier-text-color-iron);

index.html

+7
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ <h2 class="page-guide__title">{{guide.title}}</h2>
159159
>
160160
{{ item.tier }}
161161
</div>
162+
<button
163+
class="search-result-item__open-button"
164+
title="View guide"
165+
@click="$emit('guide-open', item.id)"
166+
>
167+
<i class="fas fa-arrow-right"></i>
168+
</button>
162169
</div>
163170
<div class="search-result-item__stats">
164171
<div class="search-result-item__stats-entry">

0 commit comments

Comments
 (0)