mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
5476575d10
+ fix `play next` bug + add new folder banner image + add new now playing component + move to gray4 for accent color + increase image sizes, for clean UI
44 lines
955 B
TypeScript
44 lines
955 B
TypeScript
import { defineStore } from "pinia";
|
|
import { Playlist, Track } from "../interfaces";
|
|
|
|
enum ModalOptions {
|
|
newPlaylist,
|
|
updatePlaylist,
|
|
welcome,
|
|
}
|
|
|
|
export default defineStore("newModal", {
|
|
state: () => ({
|
|
title: "",
|
|
options: ModalOptions,
|
|
component: <any>null,
|
|
props: <any>{},
|
|
visible: false,
|
|
}),
|
|
actions: {
|
|
showModal(modalOption: ModalOptions) {
|
|
this.component = modalOption;
|
|
this.visible = true;
|
|
},
|
|
showNewPlaylistModal(track?: Track) {
|
|
if (track) {
|
|
this.props.track = track;
|
|
}
|
|
this.showModal(ModalOptions.newPlaylist);
|
|
},
|
|
showEditPlaylistModal(playlist: Playlist) {
|
|
this.props = playlist;
|
|
this.showModal(ModalOptions.updatePlaylist);
|
|
},
|
|
showWelcomeModal() {
|
|
this.showModal(ModalOptions.welcome);
|
|
},
|
|
hideModal() {
|
|
this.visible = false;
|
|
},
|
|
setTitle(new_title: string) {
|
|
this.title = new_title;
|
|
},
|
|
},
|
|
});
|