From 0bf39ec11e114d96d392512085d0841fd202c3cd Mon Sep 17 00:00:00 2001 From: Loris Sigrist Date: Tue, 24 Oct 2023 10:39:45 +0200 Subject: [PATCH] Improve CodeGroup API --- site/src/lib/ui/Code/CodeGroupHeader.svelte | 17 +++++---- site/src/lib/ui/Code/CodePanel.svelte | 25 ++++++++++--- site/src/lib/ui/CodeGroup.svelte | 12 +++++- .../src/routes/[[locale=locale]]/+page.svelte | 11 ++---- .../[[locale=locale]]/syntax/+page.svelte | 37 +++++++++++++++++++ 5 files changed, 81 insertions(+), 21 deletions(-) diff --git a/site/src/lib/ui/Code/CodeGroupHeader.svelte b/site/src/lib/ui/Code/CodeGroupHeader.svelte index a427856..50d5e36 100644 --- a/site/src/lib/ui/Code/CodeGroupHeader.svelte +++ b/site/src/lib/ui/Code/CodeGroupHeader.svelte @@ -1,12 +1,15 @@
{/if} - {#if tabs.length > 0} + {#if $tabs.length > 1}
- {#each tabs as tab, i} - {@const active = i === activeTab} + {#each $tabs as tab, i} + {@const active = i === $activeTab}