Add drag and drop + all exercise page

This commit is contained in:
rotimi-best
2021-07-17 22:29:12 +03:00
parent f84bbc6016
commit f976b81202
14 changed files with 277 additions and 141 deletions
+27
View File
@@ -0,0 +1,27 @@
<script>
export let tabs = [];
export let currentTab;
export let onChange;
</script>
<div class="w-full flex justify-center">
<div class="flex items-center">
{#each tabs as tab}
<button
class="relative border-r-1 border-t-0 border-b-0 border-l-0 rounded-none {currentTab ===
tab.value
? 'text-black font-bold bg-gray-100'
: 'bg-gray-200 text-gray'} focus:outline-none w-40 text-left p-3"
on:click={onChange(tab.value)}
>
{tab.label}
{#if currentTab === tab.value}
<span class="absolute w-full top-0 left-0 h-1 bg-blue-500" />
{/if}
</button>
{/each}
</div>
<slot name="content" />
</div>