Skip to content

Commit a0a0ff2

Browse files
Merge pull request #2195 from appbaseio/searchbox-examples
fix(web): searchbox examples changes
2 parents 7e44127 + bcd37e7 commit a0a0ff2

File tree

14 files changed

+220
-120
lines changed

14 files changed

+220
-120
lines changed

packages/web/examples/RichSnippets/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"license": "Apache-2.0",
77
"dependencies": {
88
"@appbaseio/reactivesearch": "4.0.0-rc.1",
9-
"react": "^17.0.0",
10-
"react-dom": "^17.0.0",
11-
"react-scripts": "3.0.1"
9+
"react": "^18.2.0",
10+
"react-dom": "^18.2.0",
11+
"react-scripts": "5.0.1"
1212
},
1313
"scripts": {
1414
"start": "react-scripts start",

packages/web/examples/SearchBoxWithAutosuggestions/src/index.css

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ body {
1515
.col {
1616
flex: 1;
1717
padding: 15px;
18+
max-width: 100%;
1819
}
1920

2021
.row > .col:first-child {
2122
border-right: 1px solid #ccc;
22-
max-width: 400px;
2323
}
2424

2525
.row > .col:last-child {
@@ -70,11 +70,6 @@ body {
7070
.authors-list {
7171
color: #9d9d9d;
7272
font-weight: bold;
73-
overflow: hidden;
74-
text-overflow: ellipsis;
75-
display: -webkit-box;
76-
-webkit-line-clamp: 2;
77-
-webkit-box-orient: vertical;
7873
}
7974

8075
.ratings-list {
@@ -151,3 +146,12 @@ body {
151146
.col .meetup-list-image {
152147
background-size: cover;
153148
}
149+
.authors-list {
150+
color: #9d9d9d;
151+
font-weight: bold;
152+
overflow: hidden;
153+
text-overflow: ellipsis;
154+
display: -webkit-box;
155+
-webkit-line-clamp: 2;
156+
-webkit-box-orient: vertical;
157+
}

packages/web/examples/SearchBoxWithAutosuggestions/src/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const Main = () => (
1515
>
1616
<div className="row">
1717
<div className="col">
18+
{' '}
1819
<SearchBox
1920
title="SearchBox"
2021
dataField={['original_title', 'original_title.search']}
@@ -37,15 +38,13 @@ const Main = () => (
3738
enableRecentSuggestions
3839
recentSuggestionsConfig={{
3940
size: 5,
40-
minHits: 5,
41+
minHits: 2,
4142
minChars: 3,
4243
index: 'movies-demo-app', // further restrict the index to search on
4344
sectionLabel: '<b>Recent suggestions 🙌🏻</b>',
4445
}}
4546
/>
46-
</div>
47-
48-
<div className="col">
47+
<br />
4948
<ReactiveList
5049
componentId="SearchResult"
5150
dataField="original_title"

packages/web/examples/SearchBoxWithInstantSearch/src/index.css

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ body {
1515
.col {
1616
flex: 1;
1717
padding: 15px;
18+
max-width: 100%;
1819
}
1920

2021
.row > .col:first-child {
2122
border-right: 1px solid #ccc;
22-
max-width: 400px;
2323
}
2424

2525
.row > .col:last-child {
@@ -70,11 +70,6 @@ body {
7070
.authors-list {
7171
color: #9d9d9d;
7272
font-weight: bold;
73-
overflow: hidden;
74-
text-overflow: ellipsis;
75-
display: -webkit-box;
76-
-webkit-line-clamp: 2;
77-
-webkit-box-orient: vertical;
7873
}
7974

8075
.ratings-list {
@@ -151,3 +146,12 @@ body {
151146
.col .meetup-list-image {
152147
background-size: cover;
153148
}
149+
.authors-list {
150+
color: #9d9d9d;
151+
font-weight: bold;
152+
overflow: hidden;
153+
text-overflow: ellipsis;
154+
display: -webkit-box;
155+
-webkit-line-clamp: 2;
156+
-webkit-box-orient: vertical;
157+
}

packages/web/examples/SearchBoxWithInstantSearch/src/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ const Main = () => (
1212
<div className="row">
1313
<div className="col">
1414
<SearchBox
15-
title="SearchBox"
15+
title="SearchBox with InstantSearch"
1616
dataField={['original_title', 'original_title.search']}
1717
componentId="MoviesSensor"
1818
autosuggest={false}
19+
showFocusShortcutsIcon={false}
1920
/>
20-
</div>
21-
22-
<div className="col">
21+
<br />
2322
<ReactiveList
2423
componentId="SearchResult"
2524
dataField="original_title"

packages/web/examples/SearchBoxWithKeyboardShortcuts/src/index.css

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ body {
1515
.col {
1616
flex: 1;
1717
padding: 15px;
18+
max-width: 100%;
1819
}
1920

2021
.row > .col:first-child {
2122
border-right: 1px solid #ccc;
22-
max-width: 400px;
2323
}
2424

2525
.row > .col:last-child {
@@ -70,11 +70,6 @@ body {
7070
.authors-list {
7171
color: #9d9d9d;
7272
font-weight: bold;
73-
overflow: hidden;
74-
text-overflow: ellipsis;
75-
display: -webkit-box;
76-
-webkit-line-clamp: 2;
77-
-webkit-box-orient: vertical;
7873
}
7974

8075
.ratings-list {
@@ -151,3 +146,12 @@ body {
151146
.col .meetup-list-image {
152147
background-size: cover;
153148
}
149+
.authors-list {
150+
color: #9d9d9d;
151+
font-weight: bold;
152+
overflow: hidden;
153+
text-overflow: ellipsis;
154+
display: -webkit-box;
155+
-webkit-line-clamp: 2;
156+
-webkit-box-orient: vertical;
157+
}

packages/web/examples/SearchBoxWithKeyboardShortcuts/src/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ const Main = () => (
1212
<div className="row">
1313
<div className="col">
1414
<SearchBox
15-
title="SearchBox"
15+
title="SearchBox with keyboard shortcuts"
1616
dataField={['original_title', 'original_title.search']}
1717
componentId="MoviesSensor"
18-
focusShortcuts={['SHIFT+Y']}
18+
focusShortcuts={['⌘ + K']}
1919
/>
20-
</div>
21-
22-
<div className="col">
20+
<br />
2321
<ReactiveList
2422
componentId="SearchResult"
2523
dataField="original_title"

packages/web/examples/SearchBoxWithPillSuggestions/src/index.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ body {
1515
.col {
1616
flex: 1;
1717
padding: 15px;
18+
max-width: 100%;
1819
}
1920

2021
.row > .col:first-child {
2122
border-right: 1px solid #ccc;
22-
max-width: 400px;
2323
}
2424

2525
.row > .col:last-child {
@@ -152,6 +152,7 @@ body {
152152
display: flex;
153153
gap: 10px;
154154
overflow: auto;
155+
margin-top: 10px;
155156
}
156157
.pill-wrapper::-webkit-scrollbar {
157158
height: 0px;

packages/web/examples/SearchBoxWithPillSuggestions/src/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const Main = () => {
2020
<div className="row">
2121
<div className="col">
2222
<SearchBox
23-
title="SearchBox"
23+
title="SearchBox with pill suggestions"
2424
defaultValue={'Free Guy'}
2525
dataField={['original_title', 'original_title.search']}
2626
componentId="MoviesSensor"
@@ -34,7 +34,7 @@ const Main = () => {
3434
error,
3535
data,
3636
value,
37-
downshiftProps: { isOpen, getItemProps },
37+
downshiftProps: { getItemProps },
3838
}) => {
3939
if (loading) {
4040
return <div>Fetching Suggestions.</div>;
@@ -46,7 +46,7 @@ const Main = () => {
4646
</div>
4747
);
4848
}
49-
return isOpen && Boolean(value.length) ? (
49+
return Boolean(value.length) ? (
5050
<div className="pill-wrapper">
5151
{data.map((suggestion, index) => (
5252
<button
@@ -63,9 +63,7 @@ const Main = () => {
6363
) : null;
6464
}}
6565
/>
66-
</div>
67-
68-
<div className="col">
66+
<br />
6967
<ReactiveList
7068
componentId="SearchResult"
7169
dataField="original_title"

packages/web/examples/SearchBoxWithTags/src/index.css

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ body {
1515
.col {
1616
flex: 1;
1717
padding: 15px;
18+
max-width: 100%;
1819
}
1920

2021
.row > .col:first-child {
2122
border-right: 1px solid #ccc;
22-
max-width: 400px;
2323
}
2424

2525
.row > .col:last-child {
@@ -70,11 +70,6 @@ body {
7070
.authors-list {
7171
color: #9d9d9d;
7272
font-weight: bold;
73-
overflow: hidden;
74-
text-overflow: ellipsis;
75-
display: -webkit-box;
76-
-webkit-line-clamp: 2;
77-
-webkit-box-orient: vertical;
7873
}
7974

8075
.ratings-list {
@@ -151,3 +146,12 @@ body {
151146
.col .meetup-list-image {
152147
background-size: cover;
153148
}
149+
.authors-list {
150+
color: #9d9d9d;
151+
font-weight: bold;
152+
overflow: hidden;
153+
text-overflow: ellipsis;
154+
display: -webkit-box;
155+
-webkit-line-clamp: 2;
156+
-webkit-box-orient: vertical;
157+
}

0 commit comments

Comments
 (0)