guh download selection buttons work

Co-authored-by: sn <baiorett@koisu.ru>
This commit is contained in:
afnzmn
2022-07-19 13:10:50 -04:00
parent 16fceb8ab0
commit da1c85e0f5
3 changed files with 39 additions and 18 deletions

View File

@@ -1,12 +1,25 @@
<script>
import DownloadSelection from '../atoms/DownloadSelection.svelte';
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher();
export let items = ['Manager', 'CLI', 'Patches', 'Integrations'];
export let activeTab = 'Manager';
$: handleTabChange = (item) => {
activeTab = item;
};
</script>
<div class="download-selection">
<DownloadSelection>Manager</DownloadSelection>
<DownloadSelection>CLI</DownloadSelection>
<DownloadSelection>Patches</DownloadSelection>
<DownloadSelection>Integrations</DownloadSelection>
{#each items as item}
<DownloadSelection active={item === activeTab}
on:click={handleTabChange(item)}>
{item}
</DownloadSelection>
{/each}
</div>
<style>
@@ -15,7 +28,6 @@
border-radius: 200px;
display: flex;
justify-content: space-between;
padding: 8px 8px;
}
</style>