diff --git a/apps/governance/src/routes/proposals/components/proposal-market-data/proposal-market-data.tsx b/apps/governance/src/routes/proposals/components/proposal-market-data/proposal-market-data.tsx index 25655c963..c46d4903c 100644 --- a/apps/governance/src/routes/proposals/components/proposal-market-data/proposal-market-data.tsx +++ b/apps/governance/src/routes/proposals/components/proposal-market-data/proposal-market-data.tsx @@ -200,7 +200,7 @@ export const ProposalMarketData = ({ title={marketData.tradableInstrument.instrument.code} open={isOpen} onChange={(isOpen) => (isOpen ? open() : close())} - size="medium" + size="large" dataTestId="market-json-dialog" > diff --git a/apps/liquidity-provision-dashboard/src/app/components/health-dialog/health-dialog.tsx b/apps/liquidity-provision-dashboard/src/app/components/health-dialog/health-dialog.tsx index 89635e313..54154316f 100644 --- a/apps/liquidity-provision-dashboard/src/app/components/health-dialog/health-dialog.tsx +++ b/apps/liquidity-provision-dashboard/src/app/components/health-dialog/health-dialog.tsx @@ -57,7 +57,7 @@ const ROWS = [ export const HealthDialog = ({ onChange, isOpen }: HealthDialogProps) => { return ( - +

{t('Health')}

diff --git a/apps/trading-e2e/src/integration/charts-depth.cy.ts b/apps/trading-e2e/src/integration/charts-depth.cy.ts index a68dbbe01..0a4e930cf 100644 --- a/apps/trading-e2e/src/integration/charts-depth.cy.ts +++ b/apps/trading-e2e/src/integration/charts-depth.cy.ts @@ -2,6 +2,7 @@ describe('charts', { tags: '@smoke' }, () => { before(() => { cy.mockTradingPage(); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.visit('/#/markets/market-0'); cy.wait('@Markets'); cy.getByTestId('Depth').click(); diff --git a/apps/trading-e2e/src/integration/closed-markets.cy.ts b/apps/trading-e2e/src/integration/closed-markets.cy.ts index f6d621ed7..e768f623b 100644 --- a/apps/trading-e2e/src/integration/closed-markets.cy.ts +++ b/apps/trading-e2e/src/integration/closed-markets.cy.ts @@ -202,6 +202,7 @@ describe('Closed markets', { tags: '@smoke' }, () => { const specDataConnection = createDataConnection(); before(() => { + cy.setOnBoardingViewed(); cy.mockGQL((req) => { aliasGQLQuery(req, 'ChainId', chainIdQuery()); aliasGQLQuery(req, 'Statistics', statisticsQuery()); @@ -455,6 +456,7 @@ describe('no closed markets', { tags: '@smoke', testIsolation: true }, () => { before(() => { cy.mockTradingPage(); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.visit('/#/markets/all'); cy.get('[data-testid="Closed markets"]').click(); }); diff --git a/apps/trading-e2e/src/integration/home-node-network.cy.ts b/apps/trading-e2e/src/integration/home-node-network.cy.ts index 02ba53d7f..e5c6ccc5d 100644 --- a/apps/trading-e2e/src/integration/home-node-network.cy.ts +++ b/apps/trading-e2e/src/integration/home-node-network.cy.ts @@ -4,6 +4,7 @@ const nodeHealthTrigger = 'node-health-trigger'; describe('home', { tags: '@regression' }, () => { before(() => { + cy.setOnBoardingViewed(); cy.mockTradingPage(); cy.mockSubscription(); cy.visit('/'); diff --git a/apps/trading-e2e/src/integration/home.cy.ts b/apps/trading-e2e/src/integration/home.cy.ts index 8b3ffc696..d5f6d774d 100644 --- a/apps/trading-e2e/src/integration/home.cy.ts +++ b/apps/trading-e2e/src/integration/home.cy.ts @@ -2,7 +2,7 @@ import { aliasGQLQuery } from '@vegaprotocol/cypress'; import type { ProposalListFieldsFragment } from '@vegaprotocol/proposals'; import * as Schema from '@vegaprotocol/types'; -const dialogContent = 'dialog-content'; +const dialogContent = 'welcome-dialog'; const generateProposal = (code: string): ProposalListFieldsFragment => ({ __typename: 'Proposal', @@ -140,43 +140,43 @@ describe('home', { tags: '@regression' }, () => { cy.wait('@MarketsData'); }); - it('redirects to market/all and displays welcome notice', () => { + it('close welcome dialog should redirect to market/all', () => { cy.url().should('eq', Cypress.config().baseUrl + `/#/markets/all`); - cy.getByTestId('welcome-notice-title').should( - 'contain.text', - 'Welcome to Console' - ); - }); - }); - - describe('no proposal nor markets found', () => { - it('there are welcome text and a link to propose market', () => { - cy.mockGQL((req) => { - const data = { - marketsConnection: { - __typename: 'MarketConnection', - edges: [], - }, - }; - aliasGQLQuery(req, 'Markets', data); - aliasGQLQuery(req, 'MarketsData', data); - aliasGQLQuery(req, 'ProposalsList', { - proposalsConnection: { - __typename: 'ProposalsConnection', - edges: null, - }, - }); + cy.getByTestId('welcome-dialog').should('be.visible'); + cy.getByTestId('welcome-title').should('contain.text', 'Console CUSTOM'); + cy.getByTestId('browse-markets-button').should('not.be.disabled'); + cy.getByTestId('get-started-banner').should('be.visible'); + cy.getByTestId('get-started-button').should('not.be.disabled'); + cy.getByTestId('dialog-close').click(); + cy.url().should('eq', Cypress.config().baseUrl + `/#/markets/all`); + cy.window().then((window) => { + expect(window.localStorage.getItem('vega_onboarding_viewed')).to.equal( + 'true' + ); }); - cy.visit('/'); - cy.wait('@Markets'); - cy.wait('@MarketsData'); - cy.getByTestId('welcome-notice-title').should( - 'contain.text', - 'Welcome to Console' - ); - cy.getByTestId('external-link') - .contains('Propose a market') - .should('exist'); + }); + + it('click browse markets button should redirect to market/all', () => { + cy.getByTestId('welcome-dialog').should('be.visible'); + cy.getByTestId('browse-markets-button').click(); + cy.url().should('eq', Cypress.config().baseUrl + `/#/markets/all`); + cy.window().then((window) => { + expect(window.localStorage.getItem('vega_onboarding_viewed')).to.equal( + 'true' + ); + }); + }); + + it('click get started button should open connect dialog', () => { + cy.getByTestId('welcome-dialog').should('be.visible'); + cy.getByTestId('get-started-button').click(); + cy.url().should('eq', Cypress.config().baseUrl + `/#/markets/all`); + cy.window().then((window) => { + expect(window.localStorage.getItem('vega_onboarding_viewed')).to.equal( + 'true' + ); + }); + cy.getByTestId('wallet-dialog-title').should('contain.text', 'Connect'); }); }); @@ -185,7 +185,7 @@ describe('home', { tags: '@regression' }, () => { cy.window().then((window) => { window.localStorage.setItem('marketId', 'market-1'); cy.visit('/'); - cy.wait('@Markets'); + cy.getByTestId('dialog-close').click(); cy.location('hash').should('equal', '#/markets/market-1'); cy.getByTestId(dialogContent).should('not.exist'); }); @@ -199,6 +199,7 @@ describe('home', { tags: '@regression' }, () => { }); cy.visit('/'); cy.wait('@Markets'); + cy.getByTestId('dialog-close').click(); cy.location('hash').should('equal', '#/markets/market-not-existing'); cy.getByTestId(dialogContent).should('not.exist'); }); diff --git a/apps/trading-e2e/src/integration/market-all.cy.ts b/apps/trading-e2e/src/integration/market-all.cy.ts index 193f3ca48..50608bcd2 100644 --- a/apps/trading-e2e/src/integration/market-all.cy.ts +++ b/apps/trading-e2e/src/integration/market-all.cy.ts @@ -9,6 +9,7 @@ const colInstrumentCode = '[col-id="tradableInstrument.instrument.code"]'; describe('markets all table', { tags: '@smoke' }, () => { beforeEach(() => { cy.clearLocalStorage().then(() => { + cy.setOnBoardingViewed(); cy.mockTradingPage( Schema.MarketState.STATE_ACTIVE, Schema.MarketTradingMode.TRADING_MODE_MONITORING_AUCTION, @@ -199,6 +200,7 @@ describe('no open markets', { tags: '@smoke', testIsolation: true }, () => { aliasGQLQuery(req, 'Markets', markets); }); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.visit('/#/markets/all'); }); diff --git a/apps/trading-e2e/src/integration/market-info.cy.ts b/apps/trading-e2e/src/integration/market-info.cy.ts index e5a4de4af..9e6fd8c08 100644 --- a/apps/trading-e2e/src/integration/market-info.cy.ts +++ b/apps/trading-e2e/src/integration/market-info.cy.ts @@ -21,6 +21,7 @@ describe('market info is displayed', { tags: '@smoke' }, () => { }); before(() => { + cy.setOnBoardingViewed(); cy.mockTradingPage(MarketState.STATE_ACTIVE); cy.mockSubscription(); cy.visit('/#/markets/market-0'); diff --git a/apps/trading-e2e/src/integration/market-liquidity.cy.ts b/apps/trading-e2e/src/integration/market-liquidity.cy.ts index 2983b80ea..fd619517d 100644 --- a/apps/trading-e2e/src/integration/market-liquidity.cy.ts +++ b/apps/trading-e2e/src/integration/market-liquidity.cy.ts @@ -36,6 +36,7 @@ const headers = [ describe('liquidity table - trading', { tags: '@smoke' }, () => { before(() => { + cy.setOnBoardingViewed(); cy.mockSubscription(); cy.mockTradingPage( Schema.MarketState.STATE_ACTIVE, @@ -119,6 +120,7 @@ describe('liquidity table - trading', { tags: '@smoke' }, () => { describe('liquidity table view', { tags: '@smoke' }, () => { before(() => { + cy.setOnBoardingViewed(); cy.mockSubscription(); cy.mockTradingPage( Schema.MarketState.STATE_ACTIVE, diff --git a/apps/trading-e2e/src/integration/market-selector.cy.ts b/apps/trading-e2e/src/integration/market-selector.cy.ts index 5268cbb82..065052ec3 100644 --- a/apps/trading-e2e/src/integration/market-selector.cy.ts +++ b/apps/trading-e2e/src/integration/market-selector.cy.ts @@ -12,6 +12,7 @@ describe('markets selector', { tags: '@smoke' }, () => { cy.window().then((window) => { window.localStorage.setItem('marketId', 'market-1'); }); + cy.setOnBoardingViewed(); cy.mockTradingPage( MarketState.STATE_ACTIVE, MarketTradingMode.TRADING_MODE_MONITORING_AUCTION, diff --git a/apps/trading-e2e/src/integration/market-summary.cy.ts b/apps/trading-e2e/src/integration/market-summary.cy.ts index f6095849d..7a4f07641 100644 --- a/apps/trading-e2e/src/integration/market-summary.cy.ts +++ b/apps/trading-e2e/src/integration/market-summary.cy.ts @@ -30,6 +30,7 @@ describe('Market trading page', () => { Schema.AuctionTrigger.AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET ); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.visit('/#/markets/market-0'); cy.wait('@MarketData'); cy.getByTestId(marketSummaryBlock).should('be.visible'); diff --git a/apps/trading-e2e/src/integration/markets-proposed.cy.ts b/apps/trading-e2e/src/integration/markets-proposed.cy.ts index afabbd5bd..7d863d2e2 100644 --- a/apps/trading-e2e/src/integration/markets-proposed.cy.ts +++ b/apps/trading-e2e/src/integration/markets-proposed.cy.ts @@ -9,6 +9,7 @@ describe('markets proposed table', { tags: '@smoke' }, () => { before(() => { cy.mockTradingPage(); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.visit('/#/markets/all'); cy.get('[data-testid="Proposed markets"]').click(); }); @@ -213,6 +214,7 @@ describe('no markets proposed', { tags: '@smoke', testIsolation: true }, () => { aliasGQLQuery(req, 'ProposalsList', proposal); }); cy.mockSubscription(); + cy.setOnBoardingViewed(); }); it('can see no markets message', () => { diff --git a/apps/trading-e2e/src/integration/markets.cy.ts b/apps/trading-e2e/src/integration/markets.cy.ts index 1a05f5ea3..2783c78b8 100644 --- a/apps/trading-e2e/src/integration/markets.cy.ts +++ b/apps/trading-e2e/src/integration/markets.cy.ts @@ -12,6 +12,7 @@ describe('markets table', { tags: '@smoke' }, () => { Schema.AuctionTrigger.AUCTION_TRIGGER_LIQUIDITY_TARGET_NOT_MET ); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.visit('/#/markets/all'); }); }); diff --git a/apps/trading-e2e/src/integration/oracle.cy.ts b/apps/trading-e2e/src/integration/oracle.cy.ts index 58a687b2b..55619d5f2 100644 --- a/apps/trading-e2e/src/integration/oracle.cy.ts +++ b/apps/trading-e2e/src/integration/oracle.cy.ts @@ -6,6 +6,7 @@ const oracleFullProfile = 'oracle-full-profile'; describe('oracle information', { tags: '@smoke' }, () => { before(() => { + cy.setOnBoardingViewed(); cy.mockTradingPage( MarketState.STATE_ACTIVE, undefined, diff --git a/apps/trading-e2e/src/integration/order-book.cy.ts b/apps/trading-e2e/src/integration/order-book.cy.ts index 5e4d5ac92..ae12be599 100644 --- a/apps/trading-e2e/src/integration/order-book.cy.ts +++ b/apps/trading-e2e/src/integration/order-book.cy.ts @@ -14,6 +14,7 @@ const resPrice = 'price-990'; describe('order book', { tags: '@smoke' }, () => { before(() => { + cy.setOnBoardingViewed(); cy.mockTradingPage(); cy.mockSubscription(); cy.visit('/#/markets/market-0'); diff --git a/apps/trading-e2e/src/integration/settings.cy.ts b/apps/trading-e2e/src/integration/settings.cy.ts index 3ae2a135d..a09223e5e 100644 --- a/apps/trading-e2e/src/integration/settings.cy.ts +++ b/apps/trading-e2e/src/integration/settings.cy.ts @@ -4,6 +4,7 @@ describe('Settings page', { tags: '@smoke' }, () => { cy.mockTradingPage(); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.visit('/'); // Only click if not already active otherwise sidebar will close diff --git a/apps/trading-e2e/src/integration/trading-chart.cy.ts b/apps/trading-e2e/src/integration/trading-chart.cy.ts index 38bdce7f4..3a6a78710 100644 --- a/apps/trading-e2e/src/integration/trading-chart.cy.ts +++ b/apps/trading-e2e/src/integration/trading-chart.cy.ts @@ -77,6 +77,7 @@ function getButtonSelectorByText(text: string): string { beforeEach(() => { cy.mockTradingPage(); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.visit('/#/markets/market-0'); cy.wait('@Markets'); }); diff --git a/apps/trading-e2e/src/integration/trading-deal-ticket-basics.cy.ts b/apps/trading-e2e/src/integration/trading-deal-ticket-basics.cy.ts index 11ab02e02..ff3384494 100644 --- a/apps/trading-e2e/src/integration/trading-deal-ticket-basics.cy.ts +++ b/apps/trading-e2e/src/integration/trading-deal-ticket-basics.cy.ts @@ -14,6 +14,7 @@ describe('deal ticket basics', { tags: '@smoke' }, () => { cy.mockTradingPage(); cy.mockSubscription(); cy.clearAllLocalStorage(); + cy.setOnBoardingViewed(); cy.visit('/#/markets/market-0'); cy.wait('@Markets'); }); diff --git a/apps/trading-e2e/src/integration/trading-deal-ticket-time-in-force.cy.ts b/apps/trading-e2e/src/integration/trading-deal-ticket-time-in-force.cy.ts index 92dc36b5f..a25bfeee0 100644 --- a/apps/trading-e2e/src/integration/trading-deal-ticket-time-in-force.cy.ts +++ b/apps/trading-e2e/src/integration/trading-deal-ticket-time-in-force.cy.ts @@ -15,6 +15,7 @@ describe('time in force validation', { tags: '@smoke' }, () => { cy.mockTradingPage(); cy.mockSubscription(); cy.clearAllLocalStorage(); + cy.setOnBoardingViewed(); cy.visit('/#/markets/market-0'); cy.wait('@Markets'); }); diff --git a/apps/trading-e2e/src/integration/trading-trades.cy.ts b/apps/trading-e2e/src/integration/trading-trades.cy.ts index cee03c631..016abd48a 100644 --- a/apps/trading-e2e/src/integration/trading-trades.cy.ts +++ b/apps/trading-e2e/src/integration/trading-trades.cy.ts @@ -9,6 +9,7 @@ describe('trades', { tags: '@smoke' }, () => { before(() => { cy.mockTradingPage(); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.intercept('POST', '/graphql', (req) => { if (req.body.operationName === 'Trades') { req.alias = '@Trades'; diff --git a/apps/trading-e2e/src/integration/wallet-vega.cy.ts b/apps/trading-e2e/src/integration/wallet-vega.cy.ts index 6afad6f86..18de0c40e 100644 --- a/apps/trading-e2e/src/integration/wallet-vega.cy.ts +++ b/apps/trading-e2e/src/integration/wallet-vega.cy.ts @@ -17,6 +17,7 @@ describe( cy.visit('/#/portfolio'); cy.mockTradingPage(); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.get('[data-testid="pathname-/portfolio"]').should('exist'); }); @@ -122,6 +123,7 @@ describe('connect vega wallet', { tags: '@smoke', testIsolation: true }, () => { cy.visit('/#/portfolio'); cy.mockTradingPage(); cy.mockSubscription(); + cy.setOnBoardingViewed(); cy.get('[data-testid="pathname-/portfolio"]').should('exist'); }); diff --git a/apps/trading/client-pages/home/home.tsx b/apps/trading/client-pages/home/home.tsx index faf0416a2..7d0b48cf2 100644 --- a/apps/trading/client-pages/home/home.tsx +++ b/apps/trading/client-pages/home/home.tsx @@ -23,7 +23,6 @@ export const Home = () => { replace: true, }); } else if (data) { - update({ shouldDisplayWelcomeDialog: true }); const marketDataId = data[0]?.id; if (marketDataId) { navigate(Links[Routes.MARKET](marketDataId), { diff --git a/apps/trading/client-pages/market/trade-grid.tsx b/apps/trading/client-pages/market/trade-grid.tsx index eac1c5ea8..3a84ee3e7 100644 --- a/apps/trading/client-pages/market/trade-grid.tsx +++ b/apps/trading/client-pages/market/trade-grid.tsx @@ -10,7 +10,6 @@ import type { Market } from '@vegaprotocol/markets'; import { Filter } from '@vegaprotocol/orders'; import { Tab, LocalStoragePersistTabs as Tabs } from '@vegaprotocol/ui-toolkit'; import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler'; -import { VegaWalletContainer } from '../../components/vega-wallet-container'; import { ResizableGrid, ResizableGridPanel, @@ -99,64 +98,48 @@ const MainGrid = memo( - - - + - - - + - - - + - - - + - - - + {FLAGS.STOP_ORDERS ? ( - - - + ) : null} - - - + - - - + diff --git a/apps/trading/client-pages/portfolio/account-history-container.tsx b/apps/trading/client-pages/portfolio/account-history-container.tsx index 6a2482c44..a179b1573 100644 --- a/apps/trading/client-pages/portfolio/account-history-container.tsx +++ b/apps/trading/client-pages/portfolio/account-history-container.tsx @@ -71,7 +71,7 @@ export const AccountHistoryContainer = () => { const { data: assets } = useAssetsDataProvider(); if (!pubKey) { - return {t('Connect wallet')}; + return {t('Please connect Vega wallet')}; } return ( diff --git a/apps/trading/client-pages/portfolio/portfolio.tsx b/apps/trading/client-pages/portfolio/portfolio.tsx index d970842e9..ca1defeb6 100644 --- a/apps/trading/client-pages/portfolio/portfolio.tsx +++ b/apps/trading/client-pages/portfolio/portfolio.tsx @@ -13,7 +13,6 @@ import { FillsContainer } from '../../components/fills-container'; import { PositionsContainer } from '../../components/positions-container'; import { WithdrawalsContainer } from './withdrawals-container'; import { OrdersContainer } from '../../components/orders-container'; -import { VegaWalletContainer } from '../../components/vega-wallet-container'; import { LedgerContainer } from '../../components/ledger-container'; import { AccountHistoryContainer } from './account-history-container'; import { @@ -62,29 +61,19 @@ export const Portfolio = () => { - - - + - - - + - - - + - - - + - - - + @@ -97,14 +86,10 @@ export const Portfolio = () => { - - - + - - - + { @@ -21,7 +20,7 @@ export const WithdrawalsContainer = () => { const { ready, delayed } = useIncompleteWithdrawals(); return ( - + <>
{
)} -
+ ); }; diff --git a/apps/trading/components/accounts-container/accounts-container.tsx b/apps/trading/components/accounts-container/accounts-container.tsx index f9159f35d..6d586de24 100644 --- a/apps/trading/components/accounts-container/accounts-container.tsx +++ b/apps/trading/components/accounts-container/accounts-container.tsx @@ -1,8 +1,8 @@ import { useCallback } from 'react'; import { Button } from '@vegaprotocol/ui-toolkit'; import { t } from '@vegaprotocol/i18n'; -import { useAssetDetailsDialogStore } from '@vegaprotocol/assets'; import { Splash } from '@vegaprotocol/ui-toolkit'; +import { useAssetDetailsDialogStore } from '@vegaprotocol/assets'; import { useVegaWallet } from '@vegaprotocol/wallet'; import type { PinnedAsset } from '@vegaprotocol/accounts'; import { AccountManager } from '@vegaprotocol/accounts'; diff --git a/apps/trading/components/constants.ts b/apps/trading/components/constants.ts index db2fa18b1..f1168e6ce 100644 --- a/apps/trading/components/constants.ts +++ b/apps/trading/components/constants.ts @@ -1,7 +1,7 @@ import { t } from '@vegaprotocol/i18n'; export const THROTTLE_UPDATE_TIME = 500; -export const RISK_ACCEPTED_KEY = 'vega_risk_accepted'; +export const ONBOARDING_VIEWED_KEY = 'vega_onboarding_viewed'; export const MAINNET_WELCOME_HEADER = t( 'Trade cash settled futures on the fully decentralised Vega network.' ); diff --git a/apps/trading/components/fills-container/fills-container.tsx b/apps/trading/components/fills-container/fills-container.tsx index 0be3cd532..a1f53bfc1 100644 --- a/apps/trading/components/fills-container/fills-container.tsx +++ b/apps/trading/components/fills-container/fills-container.tsx @@ -1,10 +1,10 @@ -import { t } from '@vegaprotocol/i18n'; -import { Splash } from '@vegaprotocol/ui-toolkit'; import { useVegaWallet } from '@vegaprotocol/wallet'; import { FillsManager } from '@vegaprotocol/fills'; import { create } from 'zustand'; import { persist } from 'zustand/middleware'; import { useDataGridEvents } from '@vegaprotocol/datagrid'; +import { t } from '@vegaprotocol/i18n'; +import { Splash } from '@vegaprotocol/ui-toolkit'; import type { DataGridSlice } from '../../stores/datagrid-store-slice'; import { createDataGridSlice } from '../../stores/datagrid-store-slice'; diff --git a/apps/trading/components/orders-container/orders-container.tsx b/apps/trading/components/orders-container/orders-container.tsx index 2f9773be5..d8c5d373e 100644 --- a/apps/trading/components/orders-container/orders-container.tsx +++ b/apps/trading/components/orders-container/orders-container.tsx @@ -1,7 +1,6 @@ import { useDataGridEvents } from '@vegaprotocol/datagrid'; +import { Filter, OrderListManager } from '@vegaprotocol/orders'; import { t } from '@vegaprotocol/i18n'; -import { Filter } from '@vegaprotocol/orders'; -import { OrderListManager } from '@vegaprotocol/orders'; import { Splash } from '@vegaprotocol/ui-toolkit'; import { useVegaWallet } from '@vegaprotocol/wallet'; import { diff --git a/apps/trading/components/sidebar/sidebar.spec.tsx b/apps/trading/components/sidebar/sidebar.spec.tsx index 7a1f6adc2..bf673133b 100644 --- a/apps/trading/components/sidebar/sidebar.spec.tsx +++ b/apps/trading/components/sidebar/sidebar.spec.tsx @@ -19,6 +19,10 @@ jest.mock('../settings', () => ({ Settings: () =>
, })); +jest.mock('../welcome-dialog', () => ({ + GetStarted: () =>
, +})); + describe('Sidebar', () => { it.each(['/markets/all', '/portfolio'])( 'does not render ticket and info', diff --git a/apps/trading/components/sidebar/sidebar.tsx b/apps/trading/components/sidebar/sidebar.tsx index 5daaba5ad..861e499cb 100644 --- a/apps/trading/components/sidebar/sidebar.tsx +++ b/apps/trading/components/sidebar/sidebar.tsx @@ -15,6 +15,7 @@ import { Tooltip } from '../../components/tooltip'; import { WithdrawContainer } from '../withdraw-container'; import { Routes as AppRoutes } from '../../pages/client-router'; import { persist } from 'zustand/middleware'; +import { GetStarted } from '../welcome-dialog'; const STORAGE_KEY = 'vega_sidebar_store'; @@ -184,6 +185,7 @@ export const SidebarContent = () => { setView({ type: ViewType.Deposit, assetId }) } /> + ); } else { @@ -207,6 +209,7 @@ export const SidebarContent = () => { return ( + ); } @@ -215,6 +218,7 @@ export const SidebarContent = () => { return ( + ); } @@ -223,6 +227,7 @@ export const SidebarContent = () => { return ( + ); } diff --git a/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.spec.tsx b/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.spec.tsx index 8a2635d41..b572323a1 100644 --- a/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.spec.tsx +++ b/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.spec.tsx @@ -27,6 +27,16 @@ describe('VegaWalletConnectButton', () => { it('should fire dialog when not connected', () => { render(generateJsx({ pubKey: null } as VegaWalletContextShape)); + const button = screen.getByTestId('connect-vega-wallet'); + expect(button).toHaveTextContent('Get started'); + fireEvent.click(button); + expect(mockUpdateDialogOpen).toHaveBeenCalled(); + }); + + it('should render "Connect" when browser wallet is detected', () => { + window.vega = window.vega || ({} as Vega); + render(generateJsx({ pubKey: null } as VegaWalletContextShape)); + const button = screen.getByTestId('connect-vega-wallet'); expect(button).toHaveTextContent('Connect'); fireEvent.click(button); diff --git a/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx b/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx index d079b758d..0a1bb8f80 100644 --- a/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx +++ b/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx @@ -1,5 +1,6 @@ import { useMemo, useState } from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; +import { isBrowserWalletInstalled } from '@vegaprotocol/wallet'; import { truncateByChars } from '@vegaprotocol/utils'; import { t } from '@vegaprotocol/i18n'; import { @@ -37,7 +38,7 @@ export const VegaWalletConnectButton = () => { fetchPubKeys, } = useVegaWallet(); const isConnected = pubKey !== null; - + const walletInstalled = isBrowserWalletInstalled(); const activeKey = useMemo(() => { return pubKeys?.find((pk) => pk.publicKey === pubKey); }, [pubKey, pubKeys]); @@ -118,7 +119,9 @@ export const VegaWalletConnectButton = () => { intent={Intent.None} icon={} > - {t('Connect')} + + {walletInstalled ? t('Connect') : t('Get started')} + ); }; diff --git a/apps/trading/components/welcome-dialog/get-started.tsx b/apps/trading/components/welcome-dialog/get-started.tsx new file mode 100644 index 000000000..35b30445d --- /dev/null +++ b/apps/trading/components/welcome-dialog/get-started.tsx @@ -0,0 +1,86 @@ +import classNames from 'classnames'; +import { t } from '@vegaprotocol/i18n'; +import { ExternalLink, Intent, TradingButton } from '@vegaprotocol/ui-toolkit'; +import { + useVegaWallet, + useVegaWalletDialogStore, + isBrowserWalletInstalled, +} from '@vegaprotocol/wallet'; +import { Networks, useEnvironment } from '@vegaprotocol/environment'; +import { useLocalStorage } from '@vegaprotocol/react-helpers'; +import * as constants from '../constants'; + +interface Props { + lead?: string; +} + +export const GetStarted = ({ lead }: Props) => { + const { pubKey } = useVegaWallet(); + + const { VEGA_ENV, VEGA_NETWORKS } = useEnvironment(); + const CANONICAL_URL = VEGA_NETWORKS[VEGA_ENV] || 'https://console.vega.xyz'; + + const [, setOnboardingViewed] = useLocalStorage( + constants.ONBOARDING_VIEWED_KEY + ); + + const openVegaWalletDialog = useVegaWalletDialogStore( + (store) => store.openVegaWalletDialog + ); + + const onButtonClick = () => { + openVegaWalletDialog(); + setOnboardingViewed('true'); + }; + + if (!pubKey && !isBrowserWalletInstalled()) { + return ( +
+ {lead &&

{lead}

} +

{t('Get started')}

+
+
    +
  • {t('Get a Vega wallet')}
  • +
  • {t('Connect')}
  • +
  • {t('Deposit funds')}
  • +
  • {t('Open a position')}
  • +
+
+
+ + {t('Get started')} + +
+ {VEGA_ENV === Networks.MAINNET && ( +

+ {t('Experiment for free with virtual assets on')}{' '} + + {t('Fairground Testnet')} + +

+ )} + {VEGA_ENV === Networks.TESTNET && ( +

+ {t('Ready to trade with real funds?')}{' '} + + {t('Switch to Mainnet')} + +

+ )} +
+ ); + } + return null; +}; diff --git a/apps/trading/components/welcome-dialog/index.ts b/apps/trading/components/welcome-dialog/index.ts index 1f2f26f96..2698067c1 100644 --- a/apps/trading/components/welcome-dialog/index.ts +++ b/apps/trading/components/welcome-dialog/index.ts @@ -1,2 +1,3 @@ export * from './welcome-dialog'; export * from './risk-message'; +export * from './get-started'; diff --git a/apps/trading/components/welcome-dialog/risk-notice-dialog.spec.tsx b/apps/trading/components/welcome-dialog/risk-notice-dialog.spec.tsx deleted file mode 100644 index 8cb479a9b..000000000 --- a/apps/trading/components/welcome-dialog/risk-notice-dialog.spec.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { render, screen, fireEvent } from '@testing-library/react'; -import { Networks, useEnvironment } from '@vegaprotocol/environment'; -import { RiskNoticeDialog } from './risk-notice-dialog'; - -jest.mock('@vegaprotocol/environment'); - -const mockEnvDefinitions = { - VEGA_CONFIG_URL: 'https://config.url', - VEGA_URL: 'https://test.url', - VEGA_NETWORKS: JSON.stringify({}), -}; - -describe('Risk notice dialog', () => { - const mockOnClose = jest.fn(); - afterEach(() => { - jest.clearAllMocks(); - }); - - it.each` - assertion | network - ${'displays'} | ${Networks.CUSTOM} - ${'displays'} | ${Networks.DEVNET} - ${'displays'} | ${Networks.TESTNET} - `( - '$assertion a generic message on $network', - async ({ assertion, network }) => { - // @ts-ignore ignore mock implementation - useEnvironment.mockImplementation(() => ({ - ...mockEnvDefinitions, - VEGA_ENV: network, - })); - - render(); - - expect( - screen.getByText( - new RegExp( - `This application for trading on Vega is connected to ${network}` - ) - ) - ).toBeInTheDocument(); - - const button = screen.getByRole('button', { - name: 'Continue', - }); - fireEvent.click(button); - expect(mockOnClose).toHaveBeenCalled(); - } - ); -}); diff --git a/apps/trading/components/welcome-dialog/risk-notice-dialog.tsx b/apps/trading/components/welcome-dialog/risk-notice-dialog.tsx deleted file mode 100644 index 3bddcb885..000000000 --- a/apps/trading/components/welcome-dialog/risk-notice-dialog.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { t } from '@vegaprotocol/i18n'; -import { - Button, - Link, - VegaIcon, - VegaIconNames, -} from '@vegaprotocol/ui-toolkit'; -import { RISK_ACCEPTED_KEY } from '../constants'; -import { TelemetryApproval } from './telemetry-approval'; -import type { Networks } from '@vegaprotocol/environment'; -import { - useEnvironment, - DocsLinks, - ExternalLinks, -} from '@vegaprotocol/environment'; -import { useLocalStorage } from '@vegaprotocol/react-helpers'; - -interface Props { - onClose: () => void; - network: Networks; -} -export const RiskNoticeDialog = ({ onClose, network }: Props) => { - const [, setValue] = useLocalStorage(RISK_ACCEPTED_KEY); - - const handleAcceptRisk = () => { - onClose(); - setValue('true'); - }; - - return ( - - ); -}; - -const TestnetContent = ({ - network, - handleAcceptRisk, -}: { - network: Networks; - handleAcceptRisk: () => void; -}) => { - const { GITHUB_FEEDBACK_URL } = useEnvironment(); - return ( - <> -

- {t( - 'This application for trading on Vega is connected to %s, meaning you are free to try out trading with virtual assets and no risk.', - [network] - )} -

-

- {t( - 'Your Vega wallet must also be connected to %s, and your Ethereum wallet must be connected to Sepolia.', - [network] - )} -

- {GITHUB_FEEDBACK_URL && DocsLinks && ( -
    -
  • - - {t('Get a Vega Wallet')}{' '} - - -
  • -
  • - - {t('Learn about Vega Wallet')}{' '} - - -
  • -
  • - - {t('Provide feedback')}{' '} - - -
  • -
- )} -
- -
- - - ); -}; diff --git a/apps/trading/components/welcome-dialog/welcome-dialog-content.tsx b/apps/trading/components/welcome-dialog/welcome-dialog-content.tsx new file mode 100644 index 000000000..59485bfe7 --- /dev/null +++ b/apps/trading/components/welcome-dialog/welcome-dialog-content.tsx @@ -0,0 +1,230 @@ +import { t } from '@vegaprotocol/i18n'; +import { GetStarted } from './get-started'; +import { TradingButton } from '@vegaprotocol/ui-toolkit'; +import { useNavigate } from 'react-router-dom'; +import { Links, Routes } from '../../pages/client-router'; +import { useLocalStorage } from '@vegaprotocol/react-helpers'; +import * as constants from '../constants'; +import { Networks, useEnvironment } from '@vegaprotocol/environment'; + +export const WelcomeDialogContent = () => { + const { VEGA_ENV } = useEnvironment(); + const [, setOnboardingViewed] = useLocalStorage( + constants.ONBOARDING_VIEWED_KEY + ); + const navigate = useNavigate(); + const browseMarkets = () => { + const link = Links[Routes.MARKETS](); + navigate(link); + setOnboardingViewed('true'); + }; + const lead = + VEGA_ENV === Networks.MAINNET + ? t('Start trading on the worlds most advanced decentralised exchange.') + : t( + 'Free from the risks of real trading, Fairground is a safe and fun place to try out Vega yourself with virtual assets.' + ); + return ( +
+
+
+
    +
  • +
    + + + + + + + + + + + + +
    +
    +

    {t('Trade with no KYC')}

    + + {t( + 'Pseudonomously trade Futures markets. Spot and perps comming soon' + )} + +
    +
  • +
  • +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +

    + {t('Community generated trading pairs')} +

    + + {t('All markets are proposed and enacted by the community')} + +
    +
  • +
  • +
    + + + + + + + + + + + + + + + + + + +
    +
    +

    {t('Rewards')}

    + + {t( + 'Earn rewards for trading, market making and providing liquidity' + )} + +
    +
  • +
+ + {t('Browse the markets')} + +
+
+ +
+
+
+ ); +}; diff --git a/apps/trading/components/welcome-dialog/welcome-dialog.tsx b/apps/trading/components/welcome-dialog/welcome-dialog.tsx index 8ca2ade72..c1b6670bc 100644 --- a/apps/trading/components/welcome-dialog/welcome-dialog.tsx +++ b/apps/trading/components/welcome-dialog/welcome-dialog.tsx @@ -1,68 +1,52 @@ -import React, { useCallback } from 'react'; -import { useLocation } from 'react-router-dom'; -import { Dialog } from '@vegaprotocol/ui-toolkit'; +import React from 'react'; +import { useNavigate } from 'react-router-dom'; +import { Dialog, Intent } from '@vegaprotocol/ui-toolkit'; import { t } from '@vegaprotocol/i18n'; import { useLocalStorage } from '@vegaprotocol/react-helpers'; -import { useDataProvider } from '@vegaprotocol/data-provider'; -import { activeMarketsProvider } from '@vegaprotocol/markets'; -import * as constants from '../constants'; -import { RiskNoticeDialog } from './risk-notice-dialog'; -import { WelcomeNoticeDialog } from './welcome-notice-dialog'; -import { useGlobalStore } from '../../stores'; import { useEnvironment } from '@vegaprotocol/environment'; -import { Networks } from '@vegaprotocol/environment'; -import { isTestEnv } from '@vegaprotocol/utils'; +import { isBrowserWalletInstalled } from '@vegaprotocol/wallet'; +import * as constants from '../constants'; +import { WelcomeDialogContent } from './welcome-dialog-content'; +import { getConfig } from '@vegaprotocol/wallet'; +import { Links, Routes } from '../../pages/client-router'; +import { useGlobalStore } from '../../stores'; export const WelcomeDialog = () => { const { VEGA_ENV } = useEnvironment(); - const { pathname } = useLocation(); - let dialogContent: React.ReactNode; - let title = ''; - let size: 'small' | 'medium' = 'small'; - let onClose: ((open: boolean) => void) | undefined = undefined; - const [riskAccepted] = useLocalStorage(constants.RISK_ACCEPTED_KEY); - const { data } = useDataProvider({ - dataProvider: activeMarketsProvider, - variables: undefined, - }); + const [onBoardingViewed, setOnboardingViewed] = useLocalStorage( + constants.ONBOARDING_VIEWED_KEY + ); + const navigate = useNavigate(); + const isOnboardingDialogNeeded = + onBoardingViewed !== 'true' && !isBrowserWalletInstalled() && !getConfig(); + const marketId = useGlobalStore((store) => store.marketId); - const update = useGlobalStore((store) => store.update); - const shouldDisplayWelcomeDialog = useGlobalStore( - (store) => store.shouldDisplayWelcomeDialog + const onClose = () => { + setOnboardingViewed('true'); + const link = marketId + ? Links[Routes.MARKET](marketId) + : Links[Routes.HOME](); + navigate(link); + }; + const title = ( + + {t('Console')}{' '} + + {VEGA_ENV} + + ); - const isRiskDialogNeeded = - riskAccepted !== 'true' && VEGA_ENV !== Networks.MAINNET && !isTestEnv(); - - const isWelcomeDialogNeeded = pathname === '/' || shouldDisplayWelcomeDialog; - - const onCloseDialog = useCallback(() => { - update({ - shouldDisplayWelcomeDialog: isRiskDialogNeeded, - }); - }, [update, isRiskDialogNeeded]); - - if (isRiskDialogNeeded) { - dialogContent = ( - - ); - title = t('Vega Console'); - size = 'medium'; - } else if (isWelcomeDialogNeeded && data?.length === 0) { - dialogContent = ; - onClose = onCloseDialog; - } else { - dialogContent = null as React.ReactNode; - } - - return ( + return isOnboardingDialogNeeded ? ( - {dialogContent} + - ); + ) : null; }; diff --git a/apps/trading/components/welcome-dialog/welcome-notice-dialog.tsx b/apps/trading/components/welcome-dialog/welcome-notice-dialog.tsx deleted file mode 100644 index 7f003c6a8..000000000 --- a/apps/trading/components/welcome-dialog/welcome-notice-dialog.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { ExternalLink } from '@vegaprotocol/ui-toolkit'; -import { t } from '@vegaprotocol/i18n'; -import { - DApp, - Networks, - TOKEN_NEW_MARKET_PROPOSAL, - TOKEN_PROPOSALS, - useEnvironment, - useLinks, - ExternalLinks, -} from '@vegaprotocol/environment'; -import { ProposedMarkets } from './proposed-markets'; -import { TelemetryApproval } from './telemetry-approval'; - -export const WelcomeNoticeDialog = () => { - const { VEGA_ENV } = useEnvironment(); - const tokenLink = useLinks(DApp.Token); - const consoleFairgroundLink = useLinks(DApp.Console, Networks.TESTNET); - const isMainnet = VEGA_ENV === Networks.MAINNET; - return ( - <> -

- {t('Welcome to Console')} -

-

- {t( - 'There are no markets to trade on right now. Trading on Vega is now live, but markets need to pass a governance vote before they can be traded on. In the meantime:' - )} -

-
    - {isMainnet && ( -
  • - - {t('Try out Console')} - - {t(' on Fairground, our Testnet')} -
  • - )} -
  • - - {t('View and vote for proposed markets')} - -
  • -
  • - - {t('Propose a market')} - -
  • -
  • - - {t('Read about the mainnet launch')} - -
  • -
- {isMainnet && ( - - )} - - - ); -}; diff --git a/apps/trading/stores/global.ts b/apps/trading/stores/global.ts index f631d6827..e5b69fd04 100644 --- a/apps/trading/stores/global.ts +++ b/apps/trading/stores/global.ts @@ -5,7 +5,6 @@ import produce from 'immer'; interface GlobalStore { marketId: string | null; update: (store: Partial>) => void; - shouldDisplayWelcomeDialog: boolean; } interface PageTitleStore { @@ -15,7 +14,6 @@ interface PageTitleStore { export const useGlobalStore = create()((set) => ({ marketId: LocalStorage.getItem('marketId') || null, - shouldDisplayWelcomeDialog: false, update: (newState) => { set( produce((state: GlobalStore) => { diff --git a/libs/accounts/src/lib/accounts-manager.tsx b/libs/accounts/src/lib/accounts-manager.tsx index a80e56b49..00eace633 100644 --- a/libs/accounts/src/lib/accounts-manager.tsx +++ b/libs/accounts/src/lib/accounts-manager.tsx @@ -75,7 +75,7 @@ export const AccountBreakdownDialog = memo( }) => { return ( { if (!isOpen) { diff --git a/libs/cypress/src/index.ts b/libs/cypress/src/index.ts index 4e615f599..906083983 100644 --- a/libs/cypress/src/index.ts +++ b/libs/cypress/src/index.ts @@ -12,6 +12,7 @@ import { addUpdateCapsuleMultiSig } from './lib/commands/add-validators-to-multi import { addVegaWalletConnect, addSetVegaWallet, + addSetOnBoardingViewed, } from './lib/commands/vega-wallet-connect'; import { addMockTransactionResponse } from './lib/commands/mock-transaction-response'; import { addCreateMarket } from './lib/commands/create-market'; @@ -38,6 +39,7 @@ addGetNetworkParameters(); addUpdateCapsuleMultiSig(); addVegaWalletConnect(); addSetVegaWallet(); +addSetOnBoardingViewed(); addMockTransactionResponse(); addCreateMarket(); addConnectPublicKey(); diff --git a/libs/cypress/src/lib/commands/vega-wallet-connect.ts b/libs/cypress/src/lib/commands/vega-wallet-connect.ts index 01a2fc860..3335b7fae 100644 --- a/libs/cypress/src/lib/commands/vega-wallet-connect.ts +++ b/libs/cypress/src/lib/commands/vega-wallet-connect.ts @@ -14,6 +14,10 @@ declare global { interface Chainable { setVegaWallet(): void; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + interface Chainable { + setOnBoardingViewed(): void; + } } } @@ -60,7 +64,7 @@ export function addVegaWalletConnect() { export function addSetVegaWallet() { Cypress.Commands.add('setVegaWallet', () => { cy.window().then((win) => { - win.localStorage.setItem('vega_risk_accepted', 'true'); + win.localStorage.setItem('vega_onboarding_viewed', 'true'); win.localStorage.setItem( 'vega_wallet_config', JSON.stringify({ @@ -72,3 +76,11 @@ export function addSetVegaWallet() { }); }); } + +export function addSetOnBoardingViewed() { + Cypress.Commands.add('setOnBoardingViewed', () => { + cy.window().then((win) => { + win.localStorage.setItem('vega_onboarding_viewed', 'true'); + }); + }); +} diff --git a/libs/environment/src/components/node-switcher/node-switcher-dialog.tsx b/libs/environment/src/components/node-switcher/node-switcher-dialog.tsx index aa285eae7..70b4f04bc 100644 --- a/libs/environment/src/components/node-switcher/node-switcher-dialog.tsx +++ b/libs/environment/src/components/node-switcher/node-switcher-dialog.tsx @@ -9,7 +9,7 @@ export const NodeSwitcherDialog = ({ setOpen: (x: boolean) => void; }) => { return ( - + setOpen(false)} /> ); diff --git a/libs/ui-toolkit/src/components/dialog/dialog.tsx b/libs/ui-toolkit/src/components/dialog/dialog.tsx index 7c7550ea8..876b1c944 100644 --- a/libs/ui-toolkit/src/components/dialog/dialog.tsx +++ b/libs/ui-toolkit/src/components/dialog/dialog.tsx @@ -16,7 +16,7 @@ interface DialogProps { title?: string | ReactNode; icon?: ReactNode; intent?: Intent; - size?: 'small' | 'medium'; + size?: 'small' | 'medium' | 'large'; dataTestId?: string; } @@ -46,7 +46,8 @@ export function Dialog({ getIntentBorder(intent), { 'w-[520px]': size === 'small', - 'w-[720px] lg:w-[940px]': size === 'medium', + 'w-[680px]': size === 'medium', + 'w-[720px] lg:w-[940px]': size === 'large', } ); diff --git a/libs/ui-toolkit/src/components/trading-button/trading-button.tsx b/libs/ui-toolkit/src/components/trading-button/trading-button.tsx index 3c9e902d0..750b6bad4 100644 --- a/libs/ui-toolkit/src/components/trading-button/trading-button.tsx +++ b/libs/ui-toolkit/src/components/trading-button/trading-button.tsx @@ -24,7 +24,7 @@ const getClassName = ( className?: string ) => classNames( - 'flex gap-2 items-center justify-center rounded', + 'flex gap-2 items-center justify-center rounded disabled:opacity-40', // size { 'h-12': !subLabel && size === 'large', @@ -36,12 +36,18 @@ const getClassName = ( }, // colours { - 'bg-vega-yellow dark:bg-vega-yellow': intent === Intent.Primary, - 'bg-vega-clight-500 dark:bg-vega-cdark-500': intent === Intent.None, - 'bg-vega-blue-350 dark:bg-vega-blue-650': intent === Intent.Info, - 'bg-vega-orange-350 dark:bg-vega-orange-650': intent === Intent.Warning, - 'bg-vega-red-350 dark:bg-vega-red-650': intent === Intent.Danger, - 'bg-vega-green-350 dark:bg-vega-green-650': intent === Intent.Success, + 'bg-vega-yellow hover:bg-vega-yellow-550 dark:bg-vega-yellow dark:hover:bg-vega-yellow-450': + intent === Intent.Primary, + 'bg-vega-clight-500 hover:bg-vega-clight-400 dark:bg-vega-cdark-500 dark:hover:bg-vega-cdark-400': + intent === Intent.None, + 'bg-vega-blue-350 hover:bg-vega-blue-400 dark:bg-vega-blue-650 dark:hover:bg-vega-blue-600': + intent === Intent.Info, + 'bg-vega-orange-350 hover:bg-vega-orange-400 dark:bg-vega-orange-650 dark:hover:bg-vega-orange-600': + intent === Intent.Warning, + 'bg-vega-red-350 hover:bg-vega-red-400 dark:bg-vega-red-650 dark:hover:bg-vega-red-600': + intent === Intent.Danger, + 'bg-vega-green-350 hover:bg-vega-green-400 dark:bg-vega-green-650 dark:hover:bg-vega-green-600': + intent === Intent.Success, 'text-vega-clight-50 dark:text-vega-cdark-50': intent !== Intent.Primary, 'text-vega-clight-900 dark:text-vega-cdark-900': intent === Intent.Primary, diff --git a/libs/wallet/src/index.ts b/libs/wallet/src/index.ts index 67d5f712d..dd309bcf9 100644 --- a/libs/wallet/src/index.ts +++ b/libs/wallet/src/index.ts @@ -12,5 +12,7 @@ export * from './vega-transaction-dialog'; export * from './provider'; export * from './connect-dialog'; export * from './utils'; +export * from './storage'; +export * from './is-browser-wallet-installed'; export * from './__generated__/TransactionResult'; export * from './__generated__/WithdrawalApproval'; diff --git a/libs/wallet/src/is-browser-wallet-installed.ts b/libs/wallet/src/is-browser-wallet-installed.ts new file mode 100644 index 000000000..b16e05d99 --- /dev/null +++ b/libs/wallet/src/is-browser-wallet-installed.ts @@ -0,0 +1 @@ +export const isBrowserWalletInstalled = () => Boolean(window.vega);