Skip to content

Commit 9a1fe6e

Browse files
dhayabsarahdayan
andauthored
docs(examples): align react-instantsearch example with other flavors (#968)
Co-authored-by: Sarah Dayan <[email protected]>
1 parent fb46298 commit 9a1fe6e

File tree

6 files changed

+297
-72
lines changed

6 files changed

+297
-72
lines changed

examples/react-instantsearch-hooks/src/components/Autocomplete.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ export function Autocomplete({
167167
...source,
168168
sourceId: 'querySuggestionsPlugin',
169169
onSelect({ item }) {
170-
console.log('onselect', item.__autocomplete_qsCategory);
171170
setInstantSearchUiState({
172171
query: item.query,
173172
category: item.__autocomplete_qsCategory || '',
460 KB
Loading
41.2 KB
Loading
Lines changed: 102 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,113 @@
1-
em {
2-
background: cyan;
3-
font-style: normal;
1+
* {
2+
box-sizing: border-box;
43
}
54

6-
.container {
7-
max-width: 800px;
5+
body {
6+
margin: 0;
7+
padding: 0;
8+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
9+
Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
10+
background-color: rgb(244, 244, 249);
11+
color: rgb(65, 65, 65);
12+
}
13+
14+
a {
15+
color: var(--aa-primary-color);
16+
text-decoration: none;
17+
}
18+
19+
.header {
20+
background: rgb(252 252 255 / 92%);
21+
box-shadow: 0 0 0 1px rgba(35, 38, 59, 0.05),
22+
0 1px 3px 0 rgba(35, 38, 59, 0.15);
23+
padding: 0.5rem 0;
24+
position: fixed;
25+
top: 0;
26+
width: 100%;
27+
}
28+
29+
.header-wrapper {
30+
align-items: center;
31+
display: grid;
32+
grid-template-columns: 100px 1fr;
33+
}
34+
35+
.header-nav {
36+
font-weight: 500;
37+
}
38+
39+
.wrapper {
840
margin: 0 auto;
9-
padding: 1rem;
41+
max-width: 1200px;
42+
padding: 0 1.5rem;
43+
width: 100%;
1044
}
1145

12-
.search-panel {
46+
.container {
47+
margin-top: 3.5rem;
48+
padding: 1.5rem;
1349
display: grid;
14-
grid-template-columns: 200px 1fr;
15-
gap: 2rem;
50+
gap: 1rem;
51+
grid-template-columns: 1fr 3fr;
52+
}
53+
54+
/* Autocomplete */
55+
56+
.aa-Panel {
57+
position: fixed;
58+
}
59+
60+
/* InstantSearch */
61+
62+
.ais-Hits-list {
63+
display: grid;
64+
gap: 1rem;
65+
grid-template-columns: 1fr 1fr 1fr;
66+
}
67+
68+
.ais-Hits-item {
69+
padding: 1rem !important;
70+
}
71+
72+
.hit {
73+
align-items: center;
74+
display: grid;
75+
gap: 1rem;
76+
}
77+
78+
.hit h1 {
79+
font-size: 1rem;
80+
}
81+
82+
.hit p {
83+
font-size: 0.8rem;
84+
opacity: 0.8;
85+
}
86+
87+
.hit-image {
88+
align-items: center;
89+
display: flex;
90+
height: 100px;
91+
justify-content: center;
92+
}
93+
94+
.hit-image img {
95+
max-height: 100%;
96+
}
97+
98+
.ais-HierarchicalMenu-item--selected.ais-HierarchicalMenu-item--parent
99+
> div:first-of-type
100+
.ais-HierarchicalMenu-label {
101+
font-weight: bold;
16102
}
17103

18-
.aa-Form {
19-
margin-bottom: 1rem;
104+
.ais-HierarchicalMenu-item--selected:not(.ais-HierarchicalMenu-item--parent)
105+
.ais-HierarchicalMenu-label {
106+
font-weight: bold;
20107
}
21108

22-
.pagination {
23-
margin: 2rem auto;
24-
text-align: center;
109+
.ais-Pagination {
110+
display: flex;
111+
justify-content: center;
112+
margin: 2rem 0;
25113
}

0 commit comments

Comments
 (0)