25b67009a6
* feat: add a global zustand store for managing connect dialogs and landing dialog * feat: add tests * fix: remove condition for cypress for auto connecting * chore: fix assertion in tests for vega wallet text * fix: add mock for landing dialog markets query Co-authored-by: madalinaraicu <madalina@vegaprotocol.io>
27 lines
814 B
TypeScript
27 lines
814 B
TypeScript
import type { SetState } from 'zustand';
|
|
import create from 'zustand';
|
|
|
|
interface GlobalStore {
|
|
vegaWalletConnectDialog: boolean;
|
|
setVegaWalletConnectDialog: (isOpen: boolean) => void;
|
|
vegaWalletManageDialog: boolean;
|
|
setVegaWalletManageDialog: (isOpen: boolean) => void;
|
|
landingDialog: boolean;
|
|
setLandingDialog: (isOpen: boolean) => void;
|
|
}
|
|
|
|
export const useGlobalStore = create((set: SetState<GlobalStore>) => ({
|
|
vegaWalletConnectDialog: false,
|
|
setVegaWalletConnectDialog: (isOpen: boolean) => {
|
|
set({ vegaWalletConnectDialog: isOpen });
|
|
},
|
|
vegaWalletManageDialog: false,
|
|
setVegaWalletManageDialog: (isOpen: boolean) => {
|
|
set({ vegaWalletManageDialog: isOpen });
|
|
},
|
|
landingDialog: false,
|
|
setLandingDialog: (isOpen: boolean) => {
|
|
set({ landingDialog: isOpen });
|
|
},
|
|
}));
|