2021-03-30 18:57:50 +02:00
|
|
|
<script lang="typescript">
|
2021-04-15 02:32:58 +02:00
|
|
|
import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent";
|
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-15 02:32:58 +02:00
|
|
|
export let menuItems: DynamicSvelteComponent[];
|
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-15 15:33:47 +02:00
|
|
|
@import "ts/sass/bootstrap/functions";
|
|
|
|
@import "ts/sass/bootstrap/variables";
|
2021-04-14 19:36:41 +02:00
|
|
|
|
|
|
|
ul {
|
|
|
|
background-color: $light;
|
|
|
|
|
|
|
|
&.nightMode {
|
|
|
|
background-color: $secondary;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<ul {id} class="dropdown-menu" class:nightMode>
|
2021-03-31 03:34:08 +02:00
|
|
|
{#each menuItems as menuItem}
|
2021-04-14 19:36:41 +02:00
|
|
|
<li class:nightMode>
|
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>
|