From 86c8db5547a3b56fcfd8eb83bd0d6e684985ecdd Mon Sep 17 00:00:00 2001
From: Furkan Sahin <furkan-dev@proton.me>
Date: Sat, 16 Jul 2022 01:21:36 -0400
Subject: Animate unassigned labs, mostly cleanup unused code

---
 src/components/AssignLabs/AssignLabs.svelte | 34 ++++-------------------------
 1 file changed, 4 insertions(+), 30 deletions(-)

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

diff --git a/src/components/AssignLabs/AssignLabs.svelte b/src/components/AssignLabs/AssignLabs.svelte
index 3489b36..3a326ad 100644
--- a/src/components/AssignLabs/AssignLabs.svelte
+++ b/src/components/AssignLabs/AssignLabs.svelte
@@ -4,11 +4,7 @@
   import Lab from "./LabBox.svelte";
   import PT from "./PTBox.svelte";
   import { onMount } from "svelte";
-  import {
-    parseDatabase,
-    parseDatabaseLocal,
-    parseLabSchedule,
-  } from "../../util/parser";
+  import { parseDatabaseLocal } from "../../util/parser";
 
   let selectedPeerTeacher: PeerTeacher | undefined;
 
@@ -47,32 +43,9 @@
     labs = labs;
   }
 
-  function deletePT(id: number) {
-    if (selectedPeerTeacher?.id === id) {
-      selectedPeerTeacher = undefined;
-    }
-
-    $ptStore.get(id)?.labs.forEach((lab_id) => {
-      const lab = $labStore?.get(lab_id);
-      if (lab !== undefined) lab.assigned = false;
-    });
-
-    ptStore.update((map) => {
-      map.delete(id);
-      return map;
-    });
-
-    // Self assignemnt to update `assignedLabs` and `compatibleLabs`
-    selectedPeerTeacher = selectedPeerTeacher;
-  }
-
   function assignLab(id: number) {
-    // Mark lab as assigned
     const lab = $labStore.get(id);
-    if (lab === undefined) {
-      console.error("Error lab does not exist");
-      return;
-    }
+    if (lab === undefined) return;
     lab.assigned = true;
     selectedPeerTeacher?.labs.add(id);
     updateReactiveDeclarations();
@@ -151,6 +124,7 @@
             iconName="minus-circle"
             iconClick={() => {
               unassignLab(lab.id);
+              
             }}
           />
         {/each}
@@ -166,7 +140,7 @@
     >
       {#each unassignedLabs as lab}
         <div
-          class="border rounded-xl hover:bg-sky-100 hover:text-black px-3 py-1 mx-2"
+          class="hover:animate-bounce border rounded-xl hover:bg-sky-100 hover:text-black px-3 py-1 mx-2"
         >
           <p>{lab.course}</p>
           <p>{lab.section}</p>
-- 
cgit v1.2.3

