2021-04-15 15:59:52 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
2021-03-30 18:57:50 +02:00
|
|
|
<script lang="typescript">
|
2021-04-24 00:00:32 +02:00
|
|
|
import type { ToolbarItem } from "./types";
|
2021-04-14 19:36:41 +02:00
|
|
|
import { getContext } from "svelte";
|
|
|
|
import { nightModeKey } from "./contextKeys";
|
2021-03-30 18:57:50 +02:00
|
|
|
|
2021-03-31 03:34:08 +02:00
|
|
|
export let id: string;
|
2021-04-23 18:53:52 +02:00
|
|
|
export let items: ToolbarItem[];
|
2021-04-14 19:36:41 +02:00
|
|
|
|
2021-04-15 02:32:58 +02:00
|
|
|
const nightMode = getContext<boolean>(nightModeKey);
|
2021-03-30 18:57:50 +02:00
|
|
|
</script>
|
|
|
|
|
2021-04-14 19:36:41 +02:00
|
|
|
<style lang="scss">
|
2021-04-16 18:14:09 +02:00
|
|
|
@use 'ts/sass/button_mixins' as button;
|
2021-04-14 19:36:41 +02:00
|
|
|
|
|
|
|
ul {
|
2021-04-16 18:14:09 +02:00
|
|
|
background-color: white;
|
|
|
|
border-color: var(--medium-border);
|
|
|
|
}
|
2021-04-14 19:36:41 +02:00
|
|
|
|
2021-04-16 18:14:09 +02:00
|
|
|
.night-mode {
|
|
|
|
background-color: var(--bg-color);
|
2021-04-14 19:36:41 +02:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2021-04-16 18:14:09 +02:00
|
|
|
<ul {id} class="dropdown-menu" class:night-mode={nightMode}>
|
2021-04-23 18:53:52 +02:00
|
|
|
{#each items as menuItem}
|
2021-04-16 18:14:09 +02:00
|
|
|
<li>
|
2021-04-01 01:22:06 +02:00
|
|
|
<svelte:component this={menuItem.component} {...menuItem} />
|
2021-03-31 03:34:08 +02:00
|
|
|
</li>
|
|
|
|
{/each}
|
|
|
|
</ul>
|