dodano dymki kontekstowe oraz podgląd pojazdu

This commit is contained in:
2024-03-22 23:41:43 +01:00
parent e3b72c81ea
commit c7162dbd14
12 changed files with 319 additions and 24 deletions
+34
View File
@@ -0,0 +1,34 @@
import { defineStore } from 'pinia';
export const usePopupStore = defineStore('popupStore', {
state: () => ({
popupPosition: { x: 0, y: 0 },
currentPopupComponent: null as
| null
| 'DonatorPopUp'
| 'TrainCommentsPopUp'
| 'VehiclePreviewPopUp',
currentPopupContent: '',
donatorPopupVisible: false
}),
actions: {
onPopUpShow(e: MouseEvent, componentKey: typeof this.currentPopupComponent, value?: string) {
this.popupPosition.x = e.pageX;
this.popupPosition.y = e.pageY;
this.currentPopupComponent = componentKey;
this.currentPopupContent = value ?? '';
},
onPopUpMove(e: MouseEvent) {
this.popupPosition.x = e.pageX;
this.popupPosition.y = e.pageY;
},
onPopUpHide() {
this.currentPopupComponent = null;
this.currentPopupContent = '';
}
}
});
-6
View File
@@ -11,20 +11,14 @@ export interface RegionCounters {
export interface StoreState {
region: { id: string; value: string };
isOffline: boolean;
isNewUpdate: boolean;
dispatcherStatsName: string;
dispatcherStatsData?: API.DispatcherStats.Response;
driverStatsName: string;
driverStatsData?: API.DriverStats.Response;
driverStatsStatus: Status.Data;
chosenModalTrainId?: string;
blockScroll: boolean;
modalLastClickedTarget: EventTarget | null;
}