vega-frontend-monorepo/apps/trading/components/vega-wallet-connect-dialog/vega-wallet-connect-dialog.tsx
Matthew Russell 28b4593a1d
refactor(trading,governance,wallet): wallet rewrite (#5815)
Co-authored-by: bwallacee <ben@vega.xyz>
2024-03-01 14:25:56 +00:00

31 lines
1.0 KiB
TypeScript

import {
ConnectDialogWithRiskAck,
useDialogStore,
} from '@vegaprotocol/wallet-react';
import { useOnboardingStore } from '../../stores/onboarding';
import { Networks, useEnvironment } from '@vegaprotocol/environment';
import { RiskAckContent } from '../risk-ack-content';
export const VegaWalletConnectDialog = () => {
const { VEGA_ENV } = useEnvironment();
const open = useDialogStore((store) => store.isOpen);
const setDialog = useDialogStore((store) => store.set);
const risk = useOnboardingStore((store) => store.risk);
const acceptRisk = useOnboardingStore((store) => store.acceptRisk);
const rejectRisk = useOnboardingStore((store) => store.rejectRisk);
return (
<ConnectDialogWithRiskAck
open={open}
riskAccepted={VEGA_ENV === Networks.MAINNET ? risk === 'accepted' : true}
onChange={setDialog}
onRiskAccepted={acceptRisk}
onRiskRejected={() => {
rejectRisk();
setDialog(false);
}}
riskAckContent={<RiskAckContent />}
/>
);
};