mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-04-23 01:53:46 +01:00
* Move footer when save button is enabled to the bottom, remove gap between notification console and right panel * Change the way panel height is calculated * Remove unnecessary operator * Change condition * Fix snapshot * Update panel height after animation ends and use different css for showing save button to the bottom of the page * Fix ts compile
31 lines
1.5 KiB
TypeScript
31 lines
1.5 KiB
TypeScript
import create, { UseStore } from "zustand";
|
|
import { ConsoleData } from "../Explorer/Menus/NotificationConsole/ConsoleData";
|
|
|
|
export interface NotificationConsoleState {
|
|
isExpanded: boolean;
|
|
inProgressConsoleDataIdToBeDeleted: string;
|
|
consoleData: ConsoleData | undefined;
|
|
consoleAnimationFinished: boolean;
|
|
expandConsole: () => void;
|
|
// TODO Remove this method. Add a `closeConsole` method instead
|
|
setIsExpanded: (isExpanded: boolean) => void;
|
|
// TODO These two methods badly need a refactor. Not very react friendly.
|
|
setNotificationConsoleData: (consoleData: ConsoleData) => void;
|
|
setInProgressConsoleDataIdToBeDeleted: (id: string) => void;
|
|
setConsoleAnimationFinished: (consoleAnimationFinished: boolean) => void;
|
|
}
|
|
|
|
export const useNotificationConsole: UseStore<NotificationConsoleState> = create((set) => ({
|
|
isExpanded: false,
|
|
consoleData: undefined,
|
|
inProgressConsoleDataIdToBeDeleted: "",
|
|
consoleAnimationFinished: false,
|
|
expandConsole: () => set((state) => ({ ...state, isExpanded: true })),
|
|
setIsExpanded: (isExpanded) => set((state) => ({ ...state, isExpanded })),
|
|
setNotificationConsoleData: (consoleData: ConsoleData) => set((state) => ({ ...state, consoleData })),
|
|
setInProgressConsoleDataIdToBeDeleted: (id: string) =>
|
|
set((state) => ({ ...state, inProgressConsoleDataIdToBeDeleted: id })),
|
|
setConsoleAnimationFinished: (consoleAnimationFinished: boolean) =>
|
|
set({ consoleAnimationFinished: consoleAnimationFinished }),
|
|
}));
|