From 77162ba21b70a9184e36f494676d6ce0b0a76c42 Mon Sep 17 00:00:00 2001 From: geoffrey45 Date: Thu, 4 Aug 2022 17:10:53 +0300 Subject: [PATCH] add welcome modal --- src/App.vue | 21 ++++-- src/components/WelcomeModal.vue | 116 ++++++++++++++++++++++++++++++++ src/components/modal.vue | 2 + src/stores/modal.ts | 7 +- 4 files changed, 138 insertions(+), 8 deletions(-) create mode 100644 src/components/WelcomeModal.vue diff --git a/src/App.vue b/src/App.vue index 6c9d6b81..a57c6c15 100644 --- a/src/App.vue +++ b/src/App.vue @@ -22,7 +22,12 @@ diff --git a/src/components/modal.vue b/src/components/modal.vue index 39bb197c..377e449b 100644 --- a/src/components/modal.vue +++ b/src/components/modal.vue @@ -16,6 +16,7 @@ @hideModal="hideModal" @title="title" /> + @@ -24,6 +25,7 @@ import useModalStore from "../stores/modal"; import NewPlaylist from "./modals/NewPlaylist.vue"; import UpdatePlaylist from "./modals/updatePlaylist.vue"; +import WelcomeModal from "./WelcomeModal.vue"; const modal = useModalStore(); diff --git a/src/stores/modal.ts b/src/stores/modal.ts index f7d92113..dcb45517 100644 --- a/src/stores/modal.ts +++ b/src/stores/modal.ts @@ -4,6 +4,7 @@ import { Playlist, Track } from "../interfaces"; enum ModalOptions { newPlaylist = "newPlaylist", updatePlaylist = "editPlaylist", + welcome = "welcome", } export default defineStore("newModal", { @@ -25,7 +26,7 @@ export default defineStore("newModal", { if (track) { this.props.track = track; } - + this.visible = true; }, showEditPlaylistModal(playlist: Playlist) { @@ -33,6 +34,10 @@ export default defineStore("newModal", { this.props = playlist; this.visible = true; }, + showWelcomeModal() { + this.component = ModalOptions.welcome; + this.visible = true; + }, hideModal() { this.visible = false; },