+
+
- -
- }
- to="/send-form"
- />
-
- -
- }
- to={`/receive?address=${wallet.address}`}
- />
-
- -
+ {statsigExperimentQuery.data?.group_name?.toLowerCase() === 'test' ? (
+ <>
+
- {fundButton}
+ - {sendButton}
+ - {bridgeButton}
+ >
+ ) : (
+ <>
+ - {sendButton}
+ - {receiveButton}
+ - {bridgeButton}
+ - {buyButton}
+ >
+ )}
+ -
- message="Testnets are not supported in Bridge"
+ message="Testnets are not supported in Swap"
render={({ handleClick }) => (
- }
- to="/bridge-form"
onClick={(event) => {
handleClick(event);
}}
- />
- )}
- />
-
- -
- }
- href={`${ZERION_ORIGIN}/deposit?${addWalletParams}`}
- onClick={performAction}
- target="_blank"
- rel="noopener noreferrer"
- />
-
- -
-
- message="Testnets are not supported in Swap"
- render={({ handleClick }) => (
- <>
- }
- to="/swap-form"
- onClick={(event) => {
- handleClick(event);
- }}
- />
-
-
-
- >
+ to="/swap-form"
+ style={{
+ borderRadius: 24,
+ width: '100%',
+ paddingInline: 0,
+ ['--button-background' as string]: 'var(--black)',
+ ['--button-text' as string]: 'var(--white)',
+ ['--button-background-hover' as string]: 'var(--neutral-800)',
+ }}
+ >
+
+
+
+
+ Swap
+
+
)}
/>
diff --git a/src/ui/pages/Overview/ActionButtonsRow/styles.module.css b/src/ui/pages/Overview/ActionButtonsRow/styles.module.css
index c861979220..6b42721089 100644
--- a/src/ui/pages/Overview/ActionButtonsRow/styles.module.css
+++ b/src/ui/pages/Overview/ActionButtonsRow/styles.module.css
@@ -1,34 +1,11 @@
-.containerRoot {
- container-name: action-buttons-row;
- container-type: inline-size;
-}
-
.list {
- display: grid;
+ display: flex;
gap: 8;
- grid-template-columns: repeat(5, 48px);
justify-content: space-between;
}
-.hideWhenSmall {
- display: none;
-}
-
-@container action-buttons-row (width > 390px) {
- .list {
- grid-template-columns: repeat(4, 48px) minmax(100px, 176px);
- justify-content: start;
- }
- .hideWhenSmall {
- display: block;
- }
- .showWhenSmall {
- display: none;
- }
-}
-
.actionButton {
- --btn-bg-color: var(--neutral-200);
+ --btn-bg-color: var(--neutral-100);
--btn-active-bg-color: var(--neutral-300);
--btn-color: var(--neutral-800);
}
diff --git a/src/ui/pages/Overview/Positions/EmptyPositionsView.tsx b/src/ui/pages/Overview/Positions/EmptyPositionsView.tsx
index 6b71c40392..3a71c8b9e7 100644
--- a/src/ui/pages/Overview/Positions/EmptyPositionsView.tsx
+++ b/src/ui/pages/Overview/Positions/EmptyPositionsView.tsx
@@ -1,22 +1,25 @@
-import React from 'react';
-import { useMutation, useQuery } from '@tanstack/react-query';
-import { useNavigate } from 'react-router-dom';
-import { normalizeAddress } from 'src/shared/normalizeAddress';
-import { getAddressType } from 'src/shared/wallet/classifiers';
+import React, { useRef } from 'react';
+import { useQuery } from '@tanstack/react-query';
+import ArrowCircleIcon from 'jsx:src/ui/assets/arrow-circle-outlined.svg';
import { EmptyView } from 'src/ui/components/EmptyView';
import { usePreferences } from 'src/ui/features/preferences';
import { walletPort } from 'src/ui/shared/channels';
-import { setCurrentAddress } from 'src/ui/shared/requests/setCurrentAddress';
-import { useWalletParams } from 'src/ui/shared/requests/useWalletParams';
import { Button } from 'src/ui/ui-kit/Button';
import { UIText } from 'src/ui/ui-kit/UIText';
-import { UnstyledAnchor } from 'src/ui/ui-kit/UnstyledAnchor';
-import { UnstyledLink } from 'src/ui/ui-kit/UnstyledLink';
import { VStack } from 'src/ui/ui-kit/VStack';
+import { HStack } from 'src/ui/ui-kit/HStack';
+import { type HTMLDialogElementInterface } from 'src/ui/ui-kit/ModalDialogs/HTMLDialogElementInterface';
+import { emitter } from 'src/ui/shared/events';
+import { useLocation } from 'react-router-dom';
+import {
+ ONRAMP_EXPERIMENT_NAME,
+ useStatsigExperiment,
+} from 'src/modules/statsig/statsig.client';
+import { AddFundsOptionsDialog } from '../../Receive/AddFundsOptionsDialog';
+import { EmptyPositionsViewLegacy } from './EmptyPositionsViewLegacy';
-const ZERION_ORIGIN = 'https://app.zerion.io';
-
-export function EmptyPositionsView() {
+export function EmptyPositionsViewNew() {
+ const { pathname } = useLocation();
const { data: wallet } = useQuery({
queryKey: ['wallet/uiGetCurrentWallet'],
queryFn: () => {
@@ -24,110 +27,79 @@ export function EmptyPositionsView() {
},
});
- const { data: walletGroups, isLoading } = useQuery({
- queryKey: ['wallet/uiGetWalletGroups'],
- queryFn: () => walletPort.request('uiGetWalletGroups'),
- useErrorBoundary: true,
- suspense: false,
- });
-
const { preferences } = usePreferences();
- const addWalletParams = useWalletParams(wallet);
- const navigate = useNavigate();
+ const dialogRef = useRef(null);
const isTestnetMode = preferences?.testnetMode?.on;
- const goToBridgeMutation = useMutation({
- mutationFn: async () => {
- const solanaAddress = wallet?.address;
- let ethereumAddress: string | null = null;
- if (walletGroups) {
- for (const group of walletGroups) {
- for (const wallet of group.walletContainer.wallets) {
- const address = normalizeAddress(wallet.address);
- if (getAddressType(address) === 'evm') {
- ethereumAddress = address;
- break;
- }
- }
- }
- }
- if (ethereumAddress) {
- await setCurrentAddress({ address: ethereumAddress });
- }
- return { ethereumAddress, solanaAddress };
- },
- onSuccess: ({ ethereumAddress, solanaAddress }) => {
- if (!ethereumAddress || !solanaAddress) {
- navigate('/bridge-form');
- } else {
- const params = new URLSearchParams({
- outputChain: 'solana',
- showReceiverAddressInput: 'on',
- receiverAddressInput: solanaAddress,
- to: solanaAddress,
- });
- navigate(`/bridge-form?${params.toString()}`);
- }
- },
- });
-
- if (isTestnetMode || !wallet || goToBridgeMutation.isLoading || isLoading) {
+ if (isTestnetMode || !wallet) {
return No assets yet;
}
return (
-
-
-
-
- Fund your wallet
-
- Buy or transfer crypto to get started
-
+ <>
+
+
+
+
+ Get Started
+
+ By adding crypto to your wallet
+
+
-
-
-
-
- {getAddressType(wallet.address) === 'solana' ? (
+
- ) : null}
+
-
+
+ >
);
}
+
+export function EmptyPositionsView() {
+ const { data, isLoading } = useStatsigExperiment(ONRAMP_EXPERIMENT_NAME);
+ if (isLoading) {
+ return null;
+ }
+ if (data?.group_name?.toLowerCase() === 'test') {
+ return ;
+ } else {
+ return ;
+ }
+}
diff --git a/src/ui/pages/Overview/Positions/EmptyPositionsViewLegacy.tsx b/src/ui/pages/Overview/Positions/EmptyPositionsViewLegacy.tsx
new file mode 100644
index 0000000000..8df7792d9a
--- /dev/null
+++ b/src/ui/pages/Overview/Positions/EmptyPositionsViewLegacy.tsx
@@ -0,0 +1,133 @@
+import React from 'react';
+import { useMutation, useQuery } from '@tanstack/react-query';
+import { useNavigate } from 'react-router-dom';
+import { normalizeAddress } from 'src/shared/normalizeAddress';
+import { getAddressType } from 'src/shared/wallet/classifiers';
+import { EmptyView } from 'src/ui/components/EmptyView';
+import { usePreferences } from 'src/ui/features/preferences';
+import { walletPort } from 'src/ui/shared/channels';
+import { setCurrentAddress } from 'src/ui/shared/requests/setCurrentAddress';
+import { useWalletParams } from 'src/ui/shared/requests/useWalletParams';
+import { Button } from 'src/ui/ui-kit/Button';
+import { UIText } from 'src/ui/ui-kit/UIText';
+import { UnstyledAnchor } from 'src/ui/ui-kit/UnstyledAnchor';
+import { UnstyledLink } from 'src/ui/ui-kit/UnstyledLink';
+import { VStack } from 'src/ui/ui-kit/VStack';
+
+const ZERION_ORIGIN = 'https://app.zerion.io';
+
+export function EmptyPositionsViewLegacy() {
+ const { data: wallet } = useQuery({
+ queryKey: ['wallet/uiGetCurrentWallet'],
+ queryFn: () => {
+ return walletPort.request('uiGetCurrentWallet');
+ },
+ });
+
+ const { data: walletGroups, isLoading } = useQuery({
+ queryKey: ['wallet/uiGetWalletGroups'],
+ queryFn: () => walletPort.request('uiGetWalletGroups'),
+ useErrorBoundary: true,
+ suspense: false,
+ });
+
+ const { preferences } = usePreferences();
+ const addWalletParams = useWalletParams(wallet);
+ const navigate = useNavigate();
+
+ const isTestnetMode = preferences?.testnetMode?.on;
+
+ const goToBridgeMutation = useMutation({
+ mutationFn: async () => {
+ const solanaAddress = wallet?.address;
+ let ethereumAddress: string | null = null;
+ if (walletGroups) {
+ for (const group of walletGroups) {
+ for (const wallet of group.walletContainer.wallets) {
+ const address = normalizeAddress(wallet.address);
+ if (getAddressType(address) === 'evm') {
+ ethereumAddress = address;
+ break;
+ }
+ }
+ }
+ }
+ if (ethereumAddress) {
+ await setCurrentAddress({ address: ethereumAddress });
+ }
+ return { ethereumAddress, solanaAddress };
+ },
+ onSuccess: ({ ethereumAddress, solanaAddress }) => {
+ if (!ethereumAddress || !solanaAddress) {
+ navigate('/bridge-form');
+ } else {
+ const params = new URLSearchParams({
+ outputChain: 'solana',
+ showReceiverAddressInput: 'on',
+ receiverAddressInput: solanaAddress,
+ to: solanaAddress,
+ });
+ navigate(`/bridge-form?${params.toString()}`);
+ }
+ },
+ });
+
+ if (isTestnetMode || !wallet || goToBridgeMutation.isLoading || isLoading) {
+ return No assets yet;
+ }
+
+ return (
+
+
+
+
+ Fund your wallet
+
+ Buy or transfer crypto to get started
+
+
+
+
+
+
+ {getAddressType(wallet.address) === 'solana' ? (
+
+ ) : null}
+
+
+ );
+}
diff --git a/src/ui/pages/Overview/Positions/Positions.tsx b/src/ui/pages/Overview/Positions/Positions.tsx
index 8d47d7d6c0..c79c614fa0 100644
--- a/src/ui/pages/Overview/Positions/Positions.tsx
+++ b/src/ui/pages/Overview/Positions/Positions.tsx
@@ -53,7 +53,6 @@ import { useRenderDelay } from 'src/ui/components/DelayedRender/DelayedRender';
import { minus } from 'src/ui/shared/typography';
import { useAddressPositionsFromNode } from 'src/ui/shared/requests/useAddressPositionsFromNode';
import { CenteredFillViewportView } from 'src/ui/components/FillView/FillView';
-import { EmptyView } from 'src/ui/components/EmptyView';
import { invariant } from 'src/shared/invariant';
import { ErrorBoundary } from 'src/ui/components/ErrorBoundary';
import { useStore } from '@store-unit/react';
@@ -958,7 +957,7 @@ export function Positions({
>
{emptyNetworkBalance}
- No assets yet
+
);
diff --git a/src/ui/pages/Receive/AddFundsOptionsDialog.tsx b/src/ui/pages/Receive/AddFundsOptionsDialog.tsx
new file mode 100644
index 0000000000..6c92fe167d
--- /dev/null
+++ b/src/ui/pages/Receive/AddFundsOptionsDialog.tsx
@@ -0,0 +1,129 @@
+import React from 'react';
+import type { ExternallyOwnedAccount } from 'src/shared/types/ExternallyOwnedAccount';
+import IdentityIcon from 'jsx:src/ui/assets/identity.svg';
+import QrCodeIcon from 'jsx:src/ui/assets/qr-code.svg';
+import { emitter } from 'src/ui/shared/events';
+import { useWalletParams } from 'src/ui/shared/requests/useWalletParams';
+import {
+ FrameListItemAnchor,
+ FrameListItemLink,
+} from 'src/ui/ui-kit/FrameList';
+import { Media } from 'src/ui/ui-kit/Media';
+import { BottomSheetDialog } from 'src/ui/ui-kit/ModalDialogs/BottomSheetDialog';
+import { DialogTitle } from 'src/ui/ui-kit/ModalDialogs/DialogTitle';
+import type { HTMLDialogElementInterface } from 'src/ui/ui-kit/ModalDialogs/HTMLDialogElementInterface';
+import { UIText } from 'src/ui/ui-kit/UIText';
+import { VStack } from 'src/ui/ui-kit/VStack';
+import { useOpenAndConnectToZerion } from '../Overview/ActionButtonsRow/ActionButtonsRow';
+
+const ZERION_ORIGIN = 'https://app.zerion.io';
+
+export function AddFundsOptionsDialog({
+ wallet,
+ dialogRef,
+ analytics,
+}: {
+ wallet: ExternallyOwnedAccount;
+ dialogRef: React.RefObject;
+ analytics: { pathname: string; address: string };
+}) {
+ const addWalletParams = useWalletParams(wallet);
+ const buyCryptoHref = `${ZERION_ORIGIN}/deposit?${addWalletParams}`;
+ const { handleAnchorClick } = useOpenAndConnectToZerion({
+ address: wallet.address,
+ });
+ return (
+ (
+
+ Add Funds} />
+
+ {
+ handleAnchorClick(event);
+ emitter.emit('buttonClicked', {
+ buttonName: 'Buy Crypto',
+ buttonScope: 'General',
+ pathname: analytics.pathname,
+ walletAddress: analytics.address,
+ });
+ }}
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+
+
+
+ }
+ gap={12}
+ text={
Buy Crypto}
+ vGap={4}
+ alignItems="start"
+ detailText={
+
+ Use Apple Pay, credit/debit card, or bank transfer to buy
+ crypto
+
+ }
+ />
+
+
{
+ emitter.emit('buttonClicked', {
+ buttonName: 'Receive Crypto',
+ buttonScope: 'General',
+ pathname: analytics.pathname,
+ walletAddress: analytics.address,
+ });
+ }}
+ >
+
+
+
+ }
+ gap={12}
+ text={