2022-04-16 04:17:48 +03:00
|
|
|
<script>
|
|
|
|
import { HashIcon } from "svelte-feather-icons";
|
2022-04-17 20:50:04 +03:00
|
|
|
import { channels, selectedChannel } from "../../../stores";
|
2022-04-16 04:17:48 +03:00
|
|
|
</script>
|
|
|
|
|
2022-04-17 04:08:40 +03:00
|
|
|
<div class="sidebar">
|
2022-04-17 17:56:03 +03:00
|
|
|
{#each $channels as channel (channel.id)}
|
2022-04-17 20:50:04 +03:00
|
|
|
<button on:click="{ () => $selectedChannel = channel }" class="sidebar-button" class:selected={ channel.id === $selectedChannel.id }>
|
2022-04-17 04:08:40 +03:00
|
|
|
<div>
|
|
|
|
<HashIcon />
|
|
|
|
</div>
|
|
|
|
<span>{ channel.name }</span>
|
|
|
|
</button>
|
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
|
2022-04-15 02:39:13 +03:00
|
|
|
<style>
|
|
|
|
.sidebar {
|
|
|
|
height: 100%;
|
|
|
|
width: 255px;
|
2022-04-17 04:08:40 +03:00
|
|
|
max-width: 255px;
|
2022-04-16 04:17:48 +03:00
|
|
|
padding: var(--space-sm);
|
|
|
|
background-color: var(--background-color-1);
|
2022-04-17 21:32:11 +03:00
|
|
|
border-right: 1px solid var(--background-color-2);
|
2022-04-16 04:17:48 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-button {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2022-04-17 04:08:40 +03:00
|
|
|
justify-content: left;
|
2022-04-16 04:17:48 +03:00
|
|
|
border: none;
|
|
|
|
background-color: var(--background-color-1);
|
|
|
|
padding: var(--space-sm);
|
|
|
|
margin-bottom: var(--space-xxs);
|
|
|
|
color: currentColor;
|
|
|
|
font: inherit;
|
|
|
|
border-radius: var(--radius-md);
|
2022-04-17 04:08:40 +03:00
|
|
|
width: 100%;
|
|
|
|
height: 3.4em;
|
|
|
|
text-align: center;
|
2022-04-16 04:17:48 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-button span {
|
|
|
|
margin-left: var(--space-xxs);
|
2022-04-17 04:08:40 +03:00
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-button div {
|
|
|
|
display: inline;
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
/* TODO: HACK! */
|
|
|
|
width: 24px;
|
|
|
|
height: 24px;
|
2022-04-16 04:17:48 +03:00
|
|
|
}
|
|
|
|
|
2022-04-17 20:50:04 +03:00
|
|
|
.sidebar-button.selected,
|
2022-04-16 04:17:48 +03:00
|
|
|
.sidebar-button:hover {
|
|
|
|
background-color: var(--background-color-2);
|
2022-04-15 02:39:13 +03:00
|
|
|
}
|
|
|
|
</style>
|