Skip to content

Commit 5f04cc2

Browse files
Added Algolia PoweredBy component (#46)
1 parent 48e21d4 commit 5f04cc2

File tree

3 files changed

+40
-21
lines changed

3 files changed

+40
-21
lines changed

src/Search.scss

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
grid-gap: 50px;
99
width: 1000px;
1010
grid-template-areas:
11-
"title title"
12-
"facets productlist"
13-
"pagination pagination";
14-
11+
"title title"
12+
"facets productlist"
13+
"pagination pagination";
1514

1615
#{$block}__title {
1716
text-align: center;
@@ -25,7 +24,7 @@
2524
grid-area: productlist;
2625
}
2726

28-
#{$block}__productlist .ais-Hits-list{
27+
#{$block}__productlist .ais-Hits-list {
2928
grid-area: productlist;
3029
flex: 1 1 auto;
3130
display: flex;
@@ -72,7 +71,7 @@
7271
&:after {
7372
$size: 8px;
7473
$border: 2px;
75-
content: '';
74+
content: "";
7675
position: absolute;
7776
right: 15px;
7877
top: 12px;
@@ -95,7 +94,6 @@
9594
margin-bottom: 80px;
9695
margin-top: 20px;
9796

98-
9997
.ais-Pagination-item {
10098
display: inline-block;
10199
font-size: $sizeMediumLarger;
@@ -128,25 +126,25 @@
128126

129127
grid-template-columns: 1fr;
130128
grid-template-areas:
131-
"title"
132-
"facets-toggle"
133-
"facets"
134-
"productlist"
135-
"pagination";
129+
"title"
130+
"facets-toggle"
131+
"facets"
132+
"productlist"
133+
"pagination";
136134
grid-gap: 0;
137135

138136
#{$block}__title {
139137
margin-bottom: 10px;
140138
}
141139

142-
#{$block}__facetstoggle{
140+
#{$block}__facetstoggle {
143141
display: block;
144142
}
145-
#{$block}__facetstoggleinput:checked ~ #{$block}__facetstoggle:after {
143+
#{$block}__facetstoggleinput:checked ~ #{$block}__facetstoggle:after {
146144
transform: rotate(225deg);
147145
}
148146

149-
#{$block}__facetstoggleinput:checked ~ #{$block}__facets {
147+
#{$block}__facetstoggleinput:checked ~ #{$block}__facets {
150148
max-height: 100%;
151149
border: 1px solid $firstComplimentColor;
152150
}

src/SearchBar.scss

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,30 @@
77

88
#{$block}__hints {
99
position: absolute;
10-
max-height: 200px;
11-
overflow: scroll;
1210
z-index: 2;
1311
background-color: $mainBackgroundColor;
1412
left: 0;
1513
width: 100%;
1614
border: 1px solid $secondComplimentTextColor;
15+
16+
.ais-Hits {
17+
max-height: 200px;
18+
overflow: scroll;
19+
}
20+
21+
.ais-PoweredBy {
22+
text-align: right;
23+
padding: 4px 10px;
24+
border-top: 1px solid $firstBorderColor;
25+
26+
&-text {
27+
font-size: 13px;
28+
}
29+
30+
&-logo {
31+
width: 65px;
32+
}
33+
}
1734
}
1835

1936
#{$block}__hint {
@@ -35,7 +52,8 @@
3552
background-color: $mainBackgroundColor;
3653
}
3754

38-
#{$block}__close, #{$block}__open {
55+
#{$block}__close,
56+
#{$block}__open {
3957
display: none;
4058
}
4159

@@ -66,7 +84,8 @@
6684
position: relative;
6785
}
6886

69-
.ais-SearchBox-submit, .ais-SearchBox-reset {
87+
.ais-SearchBox-submit,
88+
.ais-SearchBox-reset {
7089
position: absolute;
7190
width: 30px;
7291
height: 40px;
@@ -106,7 +125,8 @@
106125
padding: 10px 5px;
107126
}
108127

109-
#{$block}__open, #{$block}__close {
128+
#{$block}__open,
129+
#{$block}__close {
110130
display: inline-block;
111131
}
112132

src/SearchBar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from 'react';
22
import { Link, useHistory } from 'react-router-dom';
33
import useOnclickOutside from 'react-cool-onclickoutside';
4-
import { SearchBox, Hits } from 'react-instantsearch-dom';
4+
import { SearchBox, Hits, PoweredBy } from 'react-instantsearch-dom';
55
import { useTranslation } from './app-state';
66
import { createSearchUrl } from './routes';
77

@@ -98,6 +98,7 @@ export const SearchBar: React.FC<SearchBoxProps> = () => {
9898
<Hits
9999
hitComponent={Hit}
100100
/>
101+
<PoweredBy />
101102
</div>
102103
}
103104
</div>

0 commit comments

Comments
 (0)