topics trim

This commit is contained in:
Wes Bos 2020-01-09 12:12:28 -05:00
parent 5898d77828
commit 96c2fb4b7b
2 changed files with 3 additions and 1 deletions

View file

@ -32,6 +32,7 @@ const pages = [
'JavaScript', 'JavaScript',
'React', 'React',
'Node', 'Node',
'CSS',
], ],
}, },
{ {

View file

@ -44,7 +44,8 @@ export function tags() {
// sort and filter for any tags that only have 1 // sort and filter for any tags that only have 1
const tags = Object.entries(counts) const tags = Object.entries(counts)
.sort(([, countA], [, countB]) => countB - countA) .sort(([, countA], [, countB]) => countB - countA)
.filter(([, count]) => count > 1) // Only show the tag if this topic has 3 or more people in it
.filter(([, count]) => count >= 3)
.map(([name, count]) => ({ name, count })); .map(([name, count]) => ({ name, count }));
return [{ name: 'all', count: people.length }, ...tags]; return [{ name: 'all', count: people.length }, ...tags];