diff --git a/src/components/guides/AddFundsAddressDemo.tsx b/src/components/guides/AddFundsAddressDemo.tsx new file mode 100644 index 00000000..c486ae06 --- /dev/null +++ b/src/components/guides/AddFundsAddressDemo.tsx @@ -0,0 +1,15 @@ +'use client' + +import Providers from '../Providers' +import * as Demo from './Demo' +import { AddFundsToOthers } from './steps/payments/AddFundsToOthers.tsx' + +export function AddFundsAddressDemo() { + return ( + + + + + + ) +} diff --git a/src/components/guides/AddFundsDemoLoader.tsx b/src/components/guides/AddFundsDemoLoader.tsx new file mode 100644 index 00000000..bb2b6108 --- /dev/null +++ b/src/components/guides/AddFundsDemoLoader.tsx @@ -0,0 +1,90 @@ +'use client' + +import * as React from 'react' + +const loadAddressDemo = () => + import('./AddFundsAddressDemo').then((mod) => ({ default: mod.AddFundsAddressDemo })) + +const loadWalletDemo = () => + import('./AddFundsWalletDemo').then((mod) => ({ default: mod.AddFundsWalletDemo })) + +const AddressDemo = React.lazy(loadAddressDemo) +const WalletDemo = React.lazy(loadWalletDemo) + +function LoadDemoCard(props: { + description: string + load: () => Promise + loadLabel: string + title: string + Demo: React.ComponentType +}) { + const { Demo, description, load, loadLabel, title } = props + const [isLoaded, setIsLoaded] = React.useState(false) + + return ( +
+
+
+

+ {title} +

+ + demo + +
+
+
+ {isLoaded ? ( + Loading demo...

} + > + +
+ ) : ( +
+

+ {description} Load the interactive demo only when you want to use it. +

+ +
+ )} +
+
+ ) +} + +export function AddFundsAddressDemoLoader() { + return ( + + ) +} + +export function AddFundsWalletDemoLoader() { + return ( + + ) +} diff --git a/src/components/guides/AddFundsWalletDemo.tsx b/src/components/guides/AddFundsWalletDemo.tsx new file mode 100644 index 00000000..c84d92fd --- /dev/null +++ b/src/components/guides/AddFundsWalletDemo.tsx @@ -0,0 +1,27 @@ +'use client' + +import Providers from '../Providers' +import * as Demo from './Demo' +import { AddFundsToWallet } from './steps/wallet/AddFundsToWallet.tsx' +import { AddTokensToWallet } from './steps/wallet/AddTokensToWallet.tsx' +import { ConnectWallet } from './steps/wallet/ConnectWallet.tsx' +import { SetFeeToken } from './steps/wallet/SetFeeToken.tsx' +import * as Token from './tokens' + +export function AddFundsWalletDemo() { + return ( + + + + + + + + + ) +} diff --git a/src/pages/guide/use-accounts/add-funds.mdx b/src/pages/guide/use-accounts/add-funds.mdx index a38369d1..6acb7118 100644 --- a/src/pages/guide/use-accounts/add-funds.mdx +++ b/src/pages/guide/use-accounts/add-funds.mdx @@ -1,12 +1,8 @@ --- description: Get test stablecoins on Tempo Testnet using the faucet. Request pathUSD, AlphaUSD, BetaUSD, and ThetaUSD tokens for development and testing. -mipd: true -interactive: true --- -import * as Demo from '../../../components/guides/Demo.tsx' -import * as Step from '../../../components/guides/steps' -import * as Token from '../../../components/guides/tokens' +import { AddFundsAddressDemoLoader, AddFundsWalletDemoLoader } from '../../../components/guides/AddFundsDemoLoader.tsx' import { Tabs, Tab } from 'vocs' # Add Funds to Your Balance @@ -21,12 +17,7 @@ Get test tokens to build on Tempo testnet. Connect your wallet to receive test stablecoins directly.
- - - - - - + @@ -35,9 +26,7 @@ Connect your wallet to receive test stablecoins directly. Send test stablecoins to any address.
- - - + diff --git a/src/pages/quickstart/faucet.mdx b/src/pages/quickstart/faucet.mdx index cc1691cc..92877298 100644 --- a/src/pages/quickstart/faucet.mdx +++ b/src/pages/quickstart/faucet.mdx @@ -1,12 +1,8 @@ --- description: Get free test stablecoins on Tempo Testnet. Connect your wallet or enter any address to receive pathUSD, AlphaUSD, BetaUSD, and ThetaUSD. -mipd: true -interactive: true --- -import * as Demo from '../../components/guides/Demo.tsx' -import * as Step from '../../components/guides/steps' -import * as Token from '../../components/guides/tokens' +import { AddFundsAddressDemoLoader, AddFundsWalletDemoLoader } from '../../components/guides/AddFundsDemoLoader.tsx' import { Tabs, Tab } from 'vocs' @@ -22,12 +18,7 @@ Get test stablecoins on Tempo testnet. Connect your wallet to receive test stablecoins directly.
- - - - - - + @@ -36,9 +27,7 @@ Connect your wallet to receive test stablecoins directly. Send test stablecoins to any address.
- - - +