2020-01-18 00:06:42 +01:00
|
|
|
<script>
|
2020-04-17 09:16:03 +02:00
|
|
|
// This should be fetched from somewhere in the future, rather than be hardcoded.
|
|
|
|
import components from "./temporaryPanelStructure.js"
|
|
|
|
import Tab from "./ComponentTab/Tab.svelte"
|
|
|
|
|
|
|
|
const categories = components.categories
|
|
|
|
let selectedCategory = categories[0]
|
2020-01-18 00:06:42 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="root">
|
2020-04-17 09:16:03 +02:00
|
|
|
<ul class="tabs">
|
|
|
|
{#each categories as category}
|
|
|
|
<li
|
|
|
|
on:click={() => (selectedCategory = category)}
|
|
|
|
class:active={selectedCategory === category}>
|
|
|
|
{category.name}
|
2020-02-19 22:38:21 +01:00
|
|
|
</li>
|
2020-04-17 09:16:03 +02:00
|
|
|
{/each}
|
|
|
|
</ul>
|
|
|
|
<div class="panel">
|
2020-04-20 14:40:29 +02:00
|
|
|
<Tab list={selectedCategory} />
|
2020-02-19 22:38:21 +01:00
|
|
|
</div>
|
2020-01-18 00:06:42 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
2020-04-17 09:16:03 +02:00
|
|
|
.tabs {
|
2020-01-24 12:32:13 +01:00
|
|
|
display: flex;
|
2020-04-17 09:16:03 +02:00
|
|
|
justify-content: center;
|
2020-01-24 12:32:13 +01:00
|
|
|
list-style: none;
|
2020-04-17 09:16:03 +02:00
|
|
|
margin: 0 auto;
|
|
|
|
padding: 0 30px;
|
|
|
|
border-bottom: 1px solid #d8d8d8;
|
2020-01-24 12:32:13 +01:00
|
|
|
|
2020-02-18 16:41:44 +01:00
|
|
|
font-size: 14px;
|
2020-04-17 09:16:03 +02:00
|
|
|
font-weight: 500;
|
|
|
|
letter-spacing: 0.14px;
|
2020-02-18 16:41:44 +01:00
|
|
|
}
|
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
li {
|
2020-04-17 09:16:03 +02:00
|
|
|
color: #808192;
|
|
|
|
margin: 0 5px;
|
|
|
|
padding: 0 8px;
|
2020-01-24 12:32:13 +01:00
|
|
|
cursor: pointer;
|
2020-04-17 09:16:03 +02:00
|
|
|
}
|
2020-01-24 12:32:13 +01:00
|
|
|
|
2020-04-17 09:16:03 +02:00
|
|
|
.panel {
|
|
|
|
padding: 20px;
|
|
|
|
}
|
2020-02-18 20:24:18 +01:00
|
|
|
|
2020-04-17 09:16:03 +02:00
|
|
|
.active {
|
|
|
|
border-bottom: solid 3px #0055ff;
|
|
|
|
color: #393c44;
|
2020-02-18 20:24:18 +01:00
|
|
|
}
|
2020-01-18 00:06:42 +01:00
|
|
|
</style>
|