aboutsummaryrefslogtreecommitdiff
path: root/src/components/AssignLabs/LabBox.svelte
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2022-07-16 00:20:01 -0400
committerFurkan Sahin <furkan-dev@proton.me>2022-07-16 00:20:01 -0400
commit62705aefd79764b00f86bdfd16188fdec81c8b76 (patch)
treebf842f4fb5021c9e6b42672225f8f3f78eae523e /src/components/AssignLabs/LabBox.svelte
parent982d2cb09f9793fbdfcf8a1d2b2b27e4fd272469 (diff)
Successfully adding/removing labs from PeerTeachers; however need to bugfix the icon always showing a minus-circle along with the bottom unassigned-labs sections not updating
Diffstat (limited to 'src/components/AssignLabs/LabBox.svelte')
-rw-r--r--src/components/AssignLabs/LabBox.svelte34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/components/AssignLabs/LabBox.svelte b/src/components/AssignLabs/LabBox.svelte
index 7888884..0b9c8f2 100644
--- a/src/components/AssignLabs/LabBox.svelte
+++ b/src/components/AssignLabs/LabBox.svelte
@@ -5,10 +5,8 @@
export let lab: Lab;
export let assign: boolean = true;
export let selectedPeerTeacher: PeerTeacher | null = null;
-
- function onIconClick() {
- console.log("Clicked lab", lab.course, lab.section);
- }
+ export let iconClick = () => {}
+ export let iconName :string = "plus-circle";
</script>
<!-- Lab box -->
@@ -20,15 +18,27 @@
<!-- Top Half -->
<div class="flex flex-row">
<strong class="flex-grow">CSCE {lab.course} - {lab.section}</strong>
- {#if assign}
+ <Icon name="minus-circle" class="h-6 w-6" handleClick={()=>{iconClick()}}/>
+ </div>
+ </div>
+ <!-- Bottom half -->
+ <div>
+ <p class="text-xs">{lab.event.info}</p>
+ <p class="text-xs">{lab.building} {lab.room}</p>
+ </div>
+</div>
+
+ <!-- {#if assign}
<Icon
name="plus-circle"
class="h-6 w-6"
handleClick={() => {
- selectedPeerTeacher?.assignLab(lab.id);
+ iconClick()
+ // selectedPeerTeacher?.assignLab(lab.id);
//TODO Adding a lab to a PT doesn't update the current "Labs" and "PT's Labs" columns
//TODO This was handled by self assignment in the assign labs function in Scott's version, but now this logic is passed down into a child component (this component) and self-assigning down here does not seem to help
- selectedPeerTeacher = selectedPeerTeacher;
+
+ //// selectedPeerTeacher = selectedPeerTeacher;
}}
/>
{:else}
@@ -43,12 +53,4 @@
);
}}
/>
- {/if}
- </div>
- </div>
- <!-- Bottom half -->
- <div>
- <p class="text-xs">{lab.event.info}</p>
- <p class="text-xs">{lab.building} {lab.room}</p>
- </div>
-</div>
+ {/if} --> \ No newline at end of file