Skip to content

Commit 0be02f3

Browse files
committed
tweaks: increase results count and improve labels
1 parent 7085c7d commit 0be02f3

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

cra-network-aware-data-fetching/src/components/SearchBar/search-bar.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@
4444
background-size: cover;
4545
cursor: pointer;
4646
position: absolute;
47-
left: 20px;
47+
right: 20px;
4848
top: 12px;
4949
}
5050

5151
.searchbar-input {
5252
font-family: 'Abel', sans-serif;
5353
font-size: 38px;
5454
position: absolute;
55-
left: 70px;
56-
top: 7px;
55+
left: 40px;
56+
top: 5px;
5757
border: 0;
5858
background: transparent;
5959
height: 40px;

cra-network-aware-data-fetching/src/containers/IFixitSearch/ifixit-search.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
}
2828

2929
.ifixit-search-status-panel p:last-child {
30-
padding: 0 48px;
30+
/* padding: 0 48px; */
3131
}

cra-network-aware-data-fetching/src/containers/IFixitSearch/index.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const IFixitSearch = () => {
2727
const [searchResults, setSearchResults] = useState([]);
2828
const connectionEffectiveType = useConnectionEffectiveType();
2929
let searchLimit;
30-
switch(connectionEffectiveType) {
30+
switch (connectionEffectiveType) {
3131
// case 'offline':
3232
// break;
3333
case 'slow-2g':
@@ -38,16 +38,16 @@ const IFixitSearch = () => {
3838
searchLimit = 15;
3939
break;
4040
case '4g':
41-
searchLimit = 40;
41+
searchLimit = 50;
4242
break;
4343
default:
44-
searchLimit = 40;
44+
searchLimit = 50;
4545
break;
4646
}
4747

4848
const searchHandler = searchKey => {
4949
if (!searchKey) return;
50-
50+
5151
setLoading(true);
5252
const endpoint = `https://www.ifixit.com/api/2.0/search/${searchKey}?limit=${searchLimit}`;
5353

@@ -66,16 +66,15 @@ const IFixitSearch = () => {
6666
return (
6767
<div className='ifixit-search'>
6868
<div className='ifixit-search-status-panel'>
69-
<p>{`Current effective network connection: ${connectionEffectiveType}`}</p>
70-
<p>Number of results on effective network connection:</p>
71-
<p>4G: 40 results, 3G: 15 results, 2G: 5 results, slow-2g: 5 results</p>
69+
<p><strong>Current effective network connection:</strong>{` ${connectionEffectiveType}`}</p>
70+
<p><strong>Results:</strong> 4G: 50, 3G: 15, 2G: 5, slow-2g: 5</p>
7271
</div>
7372
<SearchBar search={searchHandler} />
74-
{ loading ? (
73+
{loading ? (
7574
<Spinner />
7675
) : (
77-
<List items={searchResults} />
78-
) }
76+
<List items={searchResults} />
77+
)}
7978
</div>
8079
)
8180
};

0 commit comments

Comments
 (0)