@setoelkahfi / svara / commits / 4af1a69

refactored panel thingy

mellbacon committed Jan 20, 2023 at 12:30 UTC 4af1a693721dd765aea25772dcdf98b82f3851d7
1 file changed +11 -12
src/components/Footer/Footer.svelte
+11 -12
@@ -9,6 +9,7 @@
9 import { file_language, file_linefeed, line_info } from "../Editor/scripts/Editor";
10 import Notifications from "../Notifications/Notifications.svelte";
11 import { unreadnotifications } from "../Notifications/Notifications";
12 + import InternalTerminal from "../Terminal/InternalTerminal.svelte";
13
14 let langs = [];
15 for (let l of languages) {
@@ -17,7 +18,8 @@
18 }
19 let showlangs = false;
20 const tools = [
20 - {name: "Notifications", content: Notifications}
21 + {name: "Notifications", content: Notifications, icon: Notification, action: (t) => {togglePanel(t)}},
22 + {name: "Terminal", content: InternalTerminal, icon: Terminal, action: spawnTerminal}
23 ]
24
25 async function spawnTerminal() {
@@ -53,18 +55,15 @@
55 </div>
56 </div>
57 <div id="tools">
56 - <!-- svelte-ignore a11y-click-events-have-key-events -->
57 - <span class="tool" on:click={spawnTerminal}>
58 - <Terminal />
59 - <span class="toolname">Terminal</span>
60 - </span>
58 {#each tools as tool}
62 - <span class="tool" class:updated={$unreadnotifications}>
63 - <Notification></Notification>
64 - <!-- svelte-ignore a11y-click-events-have-key-events -->
65 - <span class="toolname" on:click={() => {togglePanel(tool)}}>{tool.name}</span>
66 - <span class="notification"></span>
67 - </span>
59 + <span class="tool" class:updated={$unreadnotifications}>
60 + <svelte:component this={tool.icon}></svelte:component>
61 + <!-- svelte-ignore a11y-click-events-have-key-events -->
62 + <span class="toolname" on:click={() => {tool.action(tool)}}>{tool.name}</span>
63 + {#if tool.name === "Notifications"}
64 + <span class="notification"></span>
65 + {/if}
66 + </span>
67 {/each}
68 </div>
69 {#if $isfile}