2023-09-14 19:10:33 +00:00
|
|
|
import { Dialog, Intent } from '@vegaprotocol/ui-toolkit';
|
2023-02-28 18:56:29 +00:00
|
|
|
import { t } from '@vegaprotocol/i18n';
|
2023-08-02 15:34:04 +00:00
|
|
|
import { useEnvironment } from '@vegaprotocol/environment';
|
|
|
|
import { WelcomeDialogContent } from './welcome-dialog-content';
|
2023-09-14 19:10:33 +00:00
|
|
|
import { useOnboardingStore } from './use-get-onboarding-step';
|
2022-12-13 13:31:28 +00:00
|
|
|
|
|
|
|
export const WelcomeDialog = () => {
|
2023-05-02 21:01:33 +00:00
|
|
|
const { VEGA_ENV } = useEnvironment();
|
2023-09-01 09:00:20 +00:00
|
|
|
const dismissed = useOnboardingStore((store) => store.dismissed);
|
2023-09-14 19:10:33 +00:00
|
|
|
const dialogOpen = useOnboardingStore((store) => store.dialogOpen);
|
|
|
|
const dismiss = useOnboardingStore((store) => store.dismiss);
|
2023-01-02 16:01:06 +00:00
|
|
|
|
2023-09-14 19:10:33 +00:00
|
|
|
return (
|
2022-12-13 13:31:28 +00:00
|
|
|
<Dialog
|
2023-09-14 19:10:33 +00:00
|
|
|
open={dismissed ? false : dialogOpen}
|
|
|
|
title={
|
|
|
|
<span className="font-alpha calt" data-testid="welcome-title">
|
|
|
|
{t('Console')}{' '}
|
|
|
|
<span className="text-vega-clight-100 dark:text-vega-cdark-100">
|
|
|
|
{VEGA_ENV}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
}
|
2023-08-02 15:34:04 +00:00
|
|
|
size="medium"
|
2023-09-14 19:10:33 +00:00
|
|
|
onChange={() => dismiss()}
|
2023-08-02 15:34:04 +00:00
|
|
|
intent={Intent.None}
|
|
|
|
dataTestId="welcome-dialog"
|
2022-12-13 13:31:28 +00:00
|
|
|
>
|
2023-08-02 15:34:04 +00:00
|
|
|
<WelcomeDialogContent />
|
2022-12-13 13:31:28 +00:00
|
|
|
</Dialog>
|
2023-09-14 19:10:33 +00:00
|
|
|
);
|
2022-12-13 13:31:28 +00:00
|
|
|
};
|