Skip to content

[TOOL-3682] Dashboard: Change deploy contract status for in-app wallet #6533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { cn } from "@/lib/utils";
import { CircleCheck, CircleIcon } from "lucide-react";
import Link from "next/link";
import { useCallback, useState } from "react";
import { useActiveWallet } from "thirdweb/react";

export type DeployModalStep = {
type: "deploy" | "setNFTMetadata";
Expand Down Expand Up @@ -79,9 +80,9 @@ export function DeployStatusModal(props: {
dialogCloseClassName="hidden"
className="gap-0 p-0 md:max-w-[480px]"
>
<div className="flex flex-col gap-6 p-6">
<div className="flex flex-col gap-5 p-6">
<DialogHeader>
<DialogTitle className="font-semibold text-2xl tracking-tight">
<DialogTitle className="font-semibold text-xl tracking-tight">
Deploy Status
</DialogTitle>
</DialogHeader>
Expand Down Expand Up @@ -125,7 +126,10 @@ type DeployModalStepProps = {

function RenderDeployModalStep(props: DeployModalStepProps) {
const { isActive, hasCompleted } = props;
const { title, description } = getStepInfo(props.step);
const wallet = useActiveWallet();
const requiresSignature = wallet?.id !== "inApp";

const { title, description } = getStepInfo(props.step, requiresSignature);
return (
<div className="rounded-lg border border-border bg-card">
<div
Expand Down Expand Up @@ -158,13 +162,16 @@ type TitleAndDesc = {
description: React.ReactNode;
};

function getStepInfo(step: DeployModalStep): TitleAndDesc {
function getStepInfo(
step: DeployModalStep,
requiresSignature: boolean,
): TitleAndDesc {
switch (step.type) {
case "deploy": {
return {
title: "Deploying contract",
description:
step.signatureCount > 0
step.signatureCount > 0 && requiresSignature
? `Your wallet will prompt you to sign ${
step.signatureCount === 1 ? "the" : step.signatureCount || 1
} transaction${step.signatureCount > 1 ? "s" : ""}.`
Expand All @@ -177,7 +184,7 @@ function getStepInfo(step: DeployModalStep): TitleAndDesc {
title: "Setting NFT metadata",
description: (
<>
{step.signatureCount > 0
{step.signatureCount > 0 && requiresSignature
? "Your wallet will prompt you to sign the transaction. "
: "This may take a few seconds."}
</>
Expand Down
Loading