From 0f2240c87a5c0a22e2db97e4d2b82a52401be668 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Thu, 15 Feb 2024 17:23:22 +0000
Subject: Add modals

---
 src/components/Editor/Quest/Task/TaskConfiguration.vue | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

(limited to 'src/components/Editor/Quest/Task/TaskConfiguration.vue')

diff --git a/src/components/Editor/Quest/Task/TaskConfiguration.vue b/src/components/Editor/Quest/Task/TaskConfiguration.vue
index c31a87d..7006f18 100644
--- a/src/components/Editor/Quest/Task/TaskConfiguration.vue
+++ b/src/components/Editor/Quest/Task/TaskConfiguration.vue
@@ -1,8 +1,9 @@
 <script setup lang="ts">
 import { useSessionStore, type EditorQuest } from '@/stores/session';
-import { computed } from 'vue';
+import { computed, ref } from 'vue';
 import Button from '@/components/Control/Button.vue';
 import TaskConfigurationRow from '@/components/Editor/Quest/Task/TaskConfigurationRow.vue';
+import ChangeTaskModal from './Modal/ChangeTaskModal.vue';
 
 const props = defineProps<{
   taskId: string;
@@ -62,6 +63,8 @@ const deleteValue = (fieldName: string) => {
   delete sessionStore.getQuestById(props.quest.id)!.tasks[props.taskId].config[fieldName];
 };
 
+const showChangeModal = ref(false);
+
 </script>
 
 <template>
@@ -75,10 +78,11 @@ const deleteValue = (fieldName: string) => {
           ({{ taskType }})
         </code>
       </p>
-      <div id="task-controls">
+      <div id="task-controls" class="control-group">
         <Button
           :icon="['fas', 'fa-pen']"
           :label="'Change'"
+          @click="showChangeModal = true"
         ></Button>
         <Button
           :icon="['fas', 'fa-trash']"
@@ -122,6 +126,11 @@ const deleteValue = (fieldName: string) => {
       </div>
     </div>
   </div>
+  
+  <ChangeTaskModal
+    v-model="showChangeModal" 
+    :taskId="props.taskId"
+    />
 </template>
 
 <style scoped>
@@ -163,11 +172,6 @@ const deleteValue = (fieldName: string) => {
         color: var(--color-text-mute);
       }
     }
-    
-    #task-controls {
-      display: flex;
-      gap: 1rem;
-    }
   }
 }
 
-- 
cgit v1.2.3-70-g09d2

