diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-03-10 00:13:25 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-03-10 00:13:25 +0000 |
| commit | 9a11e0f4a38297006b89cc7bb2a60734111582e0 (patch) | |
| tree | 5ebddde79e67b659714b5dbdbfcea289f06a4ae5 /src/components/Editor/Quest/Modal/RenameQuestModal.vue | |
| parent | 817478f3cf357fc09778d9dc3cf67a667e21f042 (diff) | |
Migrate to nuxt
Diffstat (limited to 'src/components/Editor/Quest/Modal/RenameQuestModal.vue')
| -rw-r--r-- | src/components/Editor/Quest/Modal/RenameQuestModal.vue | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/components/Editor/Quest/Modal/RenameQuestModal.vue b/src/components/Editor/Quest/Modal/RenameQuestModal.vue deleted file mode 100644 index 2ad1481..0000000 --- a/src/components/Editor/Quest/Modal/RenameQuestModal.vue +++ /dev/null @@ -1,69 +0,0 @@ -<script setup lang="ts"> -import Modal from '@/components/Control/Modal.vue'; -import Button from '@/components/Control/Button.vue'; -import { computed, ref } from 'vue'; -import { useSessionStore } from '@/stores/session'; - -const model = defineModel(); - -const emit = defineEmits(['update']); - -const props = defineProps({ - questId: String, -}); - -const session = useSessionStore(); - -const newQuestId = ref(props.questId); - -const isDuplicate = computed(() => { - return session.getQuestById(newQuestId.value!) !== undefined; -}); - -</script> - -<template> - <Modal v-model="model"> - <template v-slot:header> - <h2>Rename quest '{{ questId }}'</h2> - </template> - - <template v-slot:body> - <div id="body"> - <div class="option-group"> - <label for="new-type">New quest ID</label> - <input id="new-type" name="new-type" type="text" v-model="newQuestId" /> - </div> - <p v-if="isDuplicate" class="error-text">Name is not unique.</p> - <p>A Quest ID must be unique, alphanumeric, and not contain any spaces.</p> - <div id="confirm" class="control-group"> - <Button - :icon="['fas', 'fa-times']" - :label="'Cancel'" - @click="model = false" - ></Button> - <Button - type="solid" - :icon="['fas', 'fa-check']" - :label="'Rename'" - :disabled="isDuplicate" - @click="emit('update', newQuestId)" - ></Button> - </div> - </div> - </template> - </Modal> -</template> - -<style scoped> -#confirm { - display: flex; - justify-content: flex-end; -} - -#body { - display: flex; - flex-direction: column; - gap: 0.5rem; -} -</style>
\ No newline at end of file |
