vega-frontend-monorepo/apps/trading/stores/global.ts
botond 9bcb923cc0
Feat/375: Risk notice dialog (#1096)
* feat: add risk warning modal WIP

* feat: add risk notice modal and fix broken mobile dialog styles

* fix: format

* fix: lint

* fix: format

* fix: dialog scrollbar

* fix: style issues

* fix: styles

* fix: spacing

* fix: more style fixes

* fix: more spacing

* fix: format

* fix: move logic into risk dialog from global app

* fix: brance yourselves, more style updates

* feat: add test for risk dialog
2022-09-02 15:53:38 +01:00

44 lines
1.3 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;
vegaRiskNoticeDialog: boolean;
setVegaRiskNoticeDialog: (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 });
},
vegaRiskNoticeDialog: false,
setVegaRiskNoticeDialog: (isOpen: boolean) => {
set({ vegaRiskNoticeDialog: isOpen });
},
marketId: null,
setMarketId: (id: string) => {
set({ marketId: id });
},
}));