diff --git a/apps/dashboard/src/@/components/blocks/multi-step-status/multi-step-status.stories.tsx b/apps/dashboard/src/@/components/blocks/multi-step-status/multi-step-status.stories.tsx index 451966439bc..3dbe5165115 100644 --- a/apps/dashboard/src/@/components/blocks/multi-step-status/multi-step-status.stories.tsx +++ b/apps/dashboard/src/@/components/blocks/multi-step-status/multi-step-status.stories.tsx @@ -22,41 +22,36 @@ export const AllStates: Story = { args: { steps: [ { - status: "completed", + status: { type: "completed" }, label: "Connect Wallet", - retryLabel: "Failed to connect wallet", execute: async () => { await sleep(1000); }, }, { - status: "pending", + status: { type: "pending" }, label: "Sign Message", - retryLabel: "Failed to sign message", execute: async () => { await sleep(1000); }, }, { - status: "error", + status: { type: "error", message: "This is an error message" }, label: "Approve Transaction", - retryLabel: "Transaction approval failed", execute: async () => { await sleep(1000); }, }, { - status: "idle", + status: { type: "idle" }, label: "Confirm Transaction", - retryLabel: "Transaction confirmation failed", execute: async () => { await sleep(1000); }, }, { - status: "idle", + status: { type: "idle" }, label: "Finalize", - retryLabel: "Finalization failed", execute: async () => { await sleep(1000); }, diff --git a/apps/dashboard/src/@/components/blocks/multi-step-status/multi-step-status.tsx b/apps/dashboard/src/@/components/blocks/multi-step-status/multi-step-status.tsx index 2a8cf090184..7779def1757 100644 --- a/apps/dashboard/src/@/components/blocks/multi-step-status/multi-step-status.tsx +++ b/apps/dashboard/src/@/components/blocks/multi-step-status/multi-step-status.tsx @@ -11,8 +11,14 @@ import { DynamicHeight } from "../../ui/DynamicHeight"; import { Spinner } from "../../ui/Spinner/Spinner"; export type MultiStepState = { - status: "idle" | "pending" | "completed" | "error"; - retryLabel: string; + status: + | { + type: "idle" | "pending" | "completed"; + } + | { + type: "error"; + message: string | React.ReactNode; + }; label: string; execute: () => Promise; }; @@ -25,11 +31,11 @@ export function MultiStepStatus(props: {
{props.steps.map((step) => (
- {step.status === "completed" ? ( + {step.status.type === "completed" ? ( - ) : step.status === "pending" ? ( + ) : step.status.type === "pending" ? ( - ) : step.status === "error" ? ( + ) : step.status.type === "error" ? ( ) : ( @@ -37,11 +43,11 @@ export function MultiStepStatus(props: {

- {step.status === "error" && ( + {step.status.type === "error" && (

-

{step.retryLabel}

+

+ {step.status.message} +

@@ -107,9 +108,6 @@ export function TokenDistributionBarChart(props: { ]; return ( - + ); } diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/distribution/token-sale.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/distribution/token-sale.tsx index 877720bed4c..bd65654e99b 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/distribution/token-sale.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/distribution/token-sale.tsx @@ -26,7 +26,7 @@ export function TokenSaleSection(props: {

Sale

- Make your token available for purchase by setting a price + Make your coin available for purchase by setting a price

diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/launch/launch-token.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/launch/launch-token.tsx index 91a9288fa54..c6abb12e042 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/launch/launch-token.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/launch/launch-token.tsx @@ -16,11 +16,16 @@ import { TransactionButton } from "components/buttons/TransactionButton"; import { ChainIconClient } from "components/icons/ChainIcon"; import { useTrack } from "hooks/analytics/useTrack"; import { useAllChainsData } from "hooks/chains/allChains"; -import { ArrowRightIcon, ImageOffIcon, RocketIcon } from "lucide-react"; +import { + ArrowRightIcon, + ArrowUpFromLineIcon, + ImageOffIcon, +} from "lucide-react"; import Link from "next/link"; import { useEffect, useState } from "react"; import type { ThirdwebClient } from "thirdweb"; import { useActiveWallet } from "thirdweb/react"; +import { parseError } from "../../../../../../../../../utils/errorParser"; import { StepCard } from "../create-token-card"; import type { CreateTokenFunctions } from "../create-token-page.client"; import { TokenDistributionBarChart } from "../distribution/token-distribution"; @@ -85,10 +90,10 @@ export function LaunchTokenStatus(props: { executeFn: (values: CreateAssetFormValues) => Promise, ) { return async () => { - updateStatus(index, "pending"); + updateStatus(index, { type: "pending" }); try { await executeFn(formValues); - updateStatus(index, "completed"); + updateStatus(index, { type: "completed" }); // start next one const nextStep = initialSteps[index + 1]; if (nextStep) { @@ -101,7 +106,7 @@ export function LaunchTokenStatus(props: { props.onLaunchSuccess(); } } catch (error) { - updateStatus(index, "error"); + updateStatus(index, { type: "error", message: parseError(error) }); launchTracking({ type: "error", errorMessage: @@ -115,8 +120,7 @@ export function LaunchTokenStatus(props: { const initialSteps: MultiStepState[] = [ { label: "Deploy contract", - status: "idle", - retryLabel: "Failed to deploy contract", + status: { type: "idle" }, execute: createSequenceExecutorFn(0, async (values) => { const result = await createTokenFunctions.deployContract(values); setContractLink( @@ -126,8 +130,7 @@ export function LaunchTokenStatus(props: { }, { label: "Set claim conditions", - status: "idle", - retryLabel: "Failed to set claim conditions", + status: { type: "idle" }, execute: createSequenceExecutorFn( 1, createTokenFunctions.setClaimConditions, @@ -135,8 +138,7 @@ export function LaunchTokenStatus(props: { }, { label: "Mint tokens", - status: "idle", - retryLabel: "Failed to mint tokens", + status: { type: "idle" }, execute: createSequenceExecutorFn(2, createTokenFunctions.mintTokens), }, ]; @@ -144,8 +146,7 @@ export function LaunchTokenStatus(props: { if (formValues.airdropEnabled && formValues.airdropAddresses.length > 0) { initialSteps.push({ label: "Airdrop tokens", - status: "idle", - retryLabel: "Failed to airdrop tokens", + status: { type: "idle" }, execute: createSequenceExecutorFn( 3, createTokenFunctions.airdropTokens, @@ -160,13 +161,13 @@ export function LaunchTokenStatus(props: { initialSteps[0]?.execute(); } - const isComplete = steps.every((step) => step.status === "completed"); - const isPending = steps.some((step) => step.status === "pending"); + const isComplete = steps.every((step) => step.status.type === "completed"); + const isPending = steps.some((step) => step.status.type === "pending"); return ( - - Launch Token + + Launch Coin ), }} @@ -256,7 +257,7 @@ export function LaunchTokenStatus(props: {
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/page.tsx index c46db4a6bae..d27b6f560b7 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/page.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/page.tsx @@ -89,7 +89,7 @@ function PageHeader(props: { - Create Token + Create Coin @@ -98,10 +98,10 @@ function PageHeader(props: {

- Create Token + Create Coin

- Launch an ERC-20 token for your project + Launch an ERC-20 coin for your project

diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/token-info-fieldset.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/token-info-fieldset.tsx index dc69efefc64..5eb5e0da437 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/token-info-fieldset.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/token-info-fieldset.tsx @@ -32,7 +32,7 @@ export function TokenInfoFieldset(props: { @@ -120,7 +120,7 @@ export function TokenInfoFieldset(props: { >