MCPcopy Index your code
hub / github.com/FirefoxCSS-Store/FirefoxCSS-Store.github.io / render

Function render

src/scripts/hub.ts:51–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51function render() {
52 if (!grid || !count || !emptyState) return
53
54 const query = searchInput?.value.trim().toLowerCase() ?? ''
55 const visibleCards = sortCards(cards.filter((card) => matchesSearch(card, query) && matchesTags(card)))
56 const visibleSet = new Set(visibleCards)
57
58 for (const card of cards) {
59 card.hidden = !visibleSet.has(card)
60 }
61
62 for (const card of visibleCards) {
63 grid.append(card)
64 }
65
66 count.textContent = `${visibleCards.length} ${visibleCards.length === 1 ? 'theme' : 'themes'}`
67 emptyState.hidden = visibleCards.length > 0
68}
69
70for (const button of tagButtons) {
71 button.addEventListener('click', () => {

Callers 1

hub.tsFile · 0.85

Calls 3

sortCardsFunction · 0.85
matchesSearchFunction · 0.85
matchesTagsFunction · 0.85

Tested by

no test coverage detected