Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

Commit 48bac49

Browse files
committed
fix(search): added maintenance/popularity/quality legend to results text and tweaked format of package scores
1 parent d47dfbb commit 48bac49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/components/search.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const SearchResults = ({ isLoading, matches, onSelect, terms }) => {
136136

137137
if (isLoading === false && terms && matches && matches.length) {
138138
return <div>
139-
<Color grey bold>Results:</Color><br />
139+
<Color grey bold>Results (maintenance, popularity, quality):</Color><br />
140140
<PackageSelector matches={matches} onSelect={onSelect} />
141141
</div>
142142
}
@@ -152,7 +152,7 @@ const PackageSelectIndicator = ({ isSelected }) => {
152152
return <Color green>{`${figures.pointer} `}</Color>
153153
};
154154

155-
const formatPackageScore = num => Math.round(num * 100)
155+
const formatPackageScore = num => `${ Math.round(num * 100) }%`
156156

157157
const PackageItem = ({ isSelected, value }) => {
158158
const {
@@ -173,7 +173,7 @@ const PackageItem = ({ isSelected, value }) => {
173173
const p = formatPackageScore(popularity)
174174
const q = formatPackageScore(quality)
175175

176-
return <Color green={isSelected}>{name} @{username} p {p} q {q} m {m}</Color>
176+
return <Color green={isSelected}>{name} @{username} ({m} / {p} / {q})</Color>
177177
}
178178

179179
const PackageSelector = ({ matches, onSelect }) => {

0 commit comments

Comments
 (0)