Skip to content

Commit

Permalink
Update url for community adapters (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
ambarvm authored Sep 24, 2021
1 parent 47dd3a9 commit 203342c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lib/components/ComponentIndex/CardList.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script>
export let title;
export let id = `category-${encodeURI(title)}`;
</script>

<div class="list">
<h1 id="category-{encodeURI(title)}">{title} <a href="#category-{encodeURI(title)}">#</a></h1>
<h1 {id}>{title} <a href="#{id}">#</a></h1>
<div class="grid">
<slot />
</div>
Expand Down
22 changes: 21 additions & 1 deletion src/routes/components/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,23 @@
.sort(compare(sorting));
$: categories = extractUnique(dataToDisplay, 'category');
$: filterTag = selectedTags?.map((obj) => obj.value) || [];
const categoryId = {
Animations: 'animations',
'Data Visualisation': 'data-vis',
'Design Pattern': 'design-patterns',
'Design System': 'design-systems',
'Developer Experience': 'dx',
'Forms & User Input': 'input',
Integration: 'integrations',
'Rich Text Editor': 'text-editors',
Routers: 'routers',
Stores: 'stores',
'SvelteKit Adapters': 'adapters',
Testing: 'testing',
Unclassified: 'unclassified',
'User Interaction': 'ui'
};
</script>
<svelte:head>
Expand Down Expand Up @@ -100,7 +117,10 @@
</section>
<section slot="items">
{#each categories as category}
<List title={category.label || 'Unclassified'}>
<List
title={category.label || 'Unclassified'}
id={categoryId[category.label || 'Unclassified'] || category.label}
>
{#each dataToDisplay.filter((d) => d.category === category.value) as data}
<ComponentCard {...data} manager={$packageManager} />
{/each}
Expand Down

0 comments on commit 203342c

Please sign in to comment.