try adding playlists list to context menu - unsuccsessfully

This commit is contained in:
geoffrey45
2022-03-25 20:51:22 +03:00
parent 642c524a08
commit e2544dbbdc
21 changed files with 394 additions and 75 deletions
+27
View File
@@ -0,0 +1,27 @@
import { defineStore } from "pinia";
enum ModalOptions {
newPlaylist = "newPlaylist",
editPlaylist = "editPlaylist",
}
export default defineStore("newModal", {
state: () => ({
title: "",
options: ModalOptions,
component: "",
visible: false,
}),
actions: {
showModal(modalOption: string) {
this.component = modalOption;
this.visible = true;
},
hideModal() {
this.visible = false;
},
setTitle(new_title: string) {
this.title = new_title;
},
},
});
+26
View File
@@ -0,0 +1,26 @@
import { defineStore } from "pinia";
const useNotificationStore = defineStore("notification", {
state: () => ({
text: "",
visible: false,
}),
actions: {
showNotification(new_text: string) {
this.text = new_text;
this.visible = true;
setTimeout(() => {
this.visible = false;
}, 2000);
},
},
});
class Notification {
constructor(text: string) {
useNotificationStore().showNotification(text);
}
}
export { useNotificationStore, Notification };
+14
View File
@@ -0,0 +1,14 @@
import { defineStore } from "pinia";
import { Playlist } from "../interfaces";
import { getAllPlaylists } from "../composables/playlists";
export default defineStore("playlists", {
state: () => ({
playlists: <Playlist[]>[],
}),
actions: {
fetchAll() {
},
},
});