vega-frontend-monorepo/apps/trading/stores/global.ts
Art 6211c87389
Feat/627 show asset details (#960)
* feat: show asset details (627)

* feat: show asset details (627)

fixed tests

* feat: show asset details (627)

pr suggestions

* feat: show asset details (627)

var name convention

* feat: show asset details (627)

merge confict, keys

* feat: show asset details (627)

Introduced zustand store for asset details dialog.

* feat: show asset details (627)

Made it prettier

* fix: fixed lint error in accounts-table
2022-08-17 15:10:01 +01:00

38 lines
1.1 KiB
TypeScript

import create from 'zustand';
interface GlobalStore {
vegaWalletConnectDialog: boolean;
setVegaWalletConnectDialog: (isOpen: boolean) => void;
vegaWalletManageDialog: boolean;
setVegaWalletManageDialog: (isOpen: boolean) => void;
vegaNetworkSwitcherDialog: boolean;
setVegaNetworkSwitcherDialog: (isOpen: boolean) => void;
landingDialog: boolean;
setLandingDialog: (isOpen: boolean) => void;
marketId: string | null;
setMarketId: (marketId: string) => void;
}
export const useGlobalStore = create<GlobalStore>((set) => ({
vegaWalletConnectDialog: false,
setVegaWalletConnectDialog: (isOpen: boolean) => {
set({ vegaWalletConnectDialog: isOpen });
},
vegaWalletManageDialog: false,
setVegaWalletManageDialog: (isOpen: boolean) => {
set({ vegaWalletManageDialog: isOpen });
},
vegaNetworkSwitcherDialog: false,
setVegaNetworkSwitcherDialog: (isOpen: boolean) => {
set({ vegaNetworkSwitcherDialog: isOpen });
},
landingDialog: false,
setLandingDialog: (isOpen: boolean) => {
set({ landingDialog: isOpen });
},
marketId: null,
setMarketId: (id: string) => {
set({ marketId: id });
},
}));