|
1 |
| -import React, {useEffect, useState} from 'react'; |
| 1 | +import React, { useEffect, useState } from 'react'; |
2 | 2 | import classnames from 'classnames';
|
3 | 3 |
|
4 | 4 | import Layout from '@theme/Layout';
|
@@ -62,9 +62,9 @@ class Plugin {
|
62 | 62 | }
|
63 | 63 |
|
64 | 64 | if (homepage &&
|
65 |
| - homepage !== npm && |
66 |
| - homepage !== repository && |
67 |
| - homepage !== `${repository}#readme`) { |
| 65 | + homepage !== npm && |
| 66 | + homepage !== repository && |
| 67 | + homepage !== `${repository}#readme`) { |
68 | 68 | links.push({ text: 'homepage', href: homepage });
|
69 | 69 | }
|
70 | 70 |
|
@@ -120,7 +120,7 @@ function noop(evt) {
|
120 | 120 | evt && evt.preventDefault();
|
121 | 121 | }
|
122 | 122 |
|
123 |
| -function Paginate({onPage = noop}) { |
| 123 | +function Paginate({ onPage = noop }) { |
124 | 124 | return (
|
125 | 125 | <div className="row padding-vert--md">
|
126 | 126 | <div className="col col--4 col--offset-4">
|
@@ -159,11 +159,11 @@ async function fetchPackages(keywords, searchText = '', pageNumber = 0) {
|
159 | 159 | const text = search.join(' ');
|
160 | 160 |
|
161 | 161 | try {
|
162 |
| - const initialUrl = `${baseUrl}?from=${from}&text=${text}`; |
| 162 | + const initialUrl = `${baseUrl}?from=${from}&text=${text}&quality=0.5&popularity=1.0&maintenance=0.1`; |
163 | 163 | const response = await fetch(initialUrl);
|
164 | 164 | const { total, objects } = await response.json();
|
165 | 165 | return { total, plugins: objects.map(toPlugin) };
|
166 |
| - } catch(err) { |
| 166 | + } catch (err) { |
167 | 167 | console.log(err);
|
168 | 168 | return { total: 0, plugins: [] };
|
169 | 169 | }
|
@@ -277,7 +277,7 @@ function useSearch() {
|
277 | 277 |
|
278 | 278 |
|
279 | 279 | function PluginsPage() {
|
280 |
| - const [{title, plugins, placeholder, hasMore}, {search, paginate}] = useSearch(); |
| 280 | + const [{ title, plugins, placeholder, hasMore }, { search, paginate }] = useSearch(); |
281 | 281 | const [searchInput, setSearchInput] = useState(``);
|
282 | 282 |
|
283 | 283 | let onSubmit = (evt) => {
|
|
0 commit comments