From 3fc1d1b7c2c7fd389878cff1bc4414458c167e31 Mon Sep 17 00:00:00 2001
From: Furkan Sahin <furkan-dev@proton.me>
Date: Fri, 3 Jun 2022 14:56:05 -0500
Subject: keep selected section highlighted

---
 src/components/Sidebar.svelte | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'src/components/Sidebar.svelte')

diff --git a/src/components/Sidebar.svelte b/src/components/Sidebar.svelte
index a650ab2..06cbba2 100644
--- a/src/components/Sidebar.svelte
+++ b/src/components/Sidebar.svelte
@@ -37,9 +37,12 @@
         <!-- Sidebar sections -->
         <div class="flex-col overflow-y-auto">
             <ul class="menu bg-base-100 w-full text-xl">
-                {#each sections as sec, i}
+                {#each sections as sec}
                     <li>
-                        <div class="" on:click={() => chooseSection(sec)}>
+                        <div
+                            class={selected == sec ? "active" : ""}
+                            on:click={() => chooseSection(sec)}
+                        >
                             {sec.name}
                         </div>
                     </li>
-- 
cgit v1.2.3

