Skip to content

Commit 26cfd1b

Browse files
committed
[TOOL-3682] Dashboard: Change deploy contract status for in-app wallet (#6533)
1 parent 495d8ed commit 26cfd1b

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

apps/dashboard/src/components/contract-components/contract-deploy-form/deploy-context-modal.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { cn } from "@/lib/utils";
1010
import { CircleCheck, CircleIcon } from "lucide-react";
1111
import Link from "next/link";
1212
import { useCallback, useState } from "react";
13+
import { useActiveWallet } from "thirdweb/react";
1314

1415
export type DeployModalStep = {
1516
type: "deploy" | "setNFTMetadata";
@@ -79,9 +80,9 @@ export function DeployStatusModal(props: {
7980
dialogCloseClassName="hidden"
8081
className="gap-0 p-0 md:max-w-[480px]"
8182
>
82-
<div className="flex flex-col gap-6 p-6">
83+
<div className="flex flex-col gap-5 p-6">
8384
<DialogHeader>
84-
<DialogTitle className="font-semibold text-2xl tracking-tight">
85+
<DialogTitle className="font-semibold text-xl tracking-tight">
8586
Deploy Status
8687
</DialogTitle>
8788
</DialogHeader>
@@ -125,7 +126,10 @@ type DeployModalStepProps = {
125126

126127
function RenderDeployModalStep(props: DeployModalStepProps) {
127128
const { isActive, hasCompleted } = props;
128-
const { title, description } = getStepInfo(props.step);
129+
const wallet = useActiveWallet();
130+
const requiresSignature = wallet?.id !== "inApp";
131+
132+
const { title, description } = getStepInfo(props.step, requiresSignature);
129133
return (
130134
<div className="rounded-lg border border-border bg-card">
131135
<div
@@ -158,13 +162,16 @@ type TitleAndDesc = {
158162
description: React.ReactNode;
159163
};
160164

161-
function getStepInfo(step: DeployModalStep): TitleAndDesc {
165+
function getStepInfo(
166+
step: DeployModalStep,
167+
requiresSignature: boolean,
168+
): TitleAndDesc {
162169
switch (step.type) {
163170
case "deploy": {
164171
return {
165172
title: "Deploying contract",
166173
description:
167-
step.signatureCount > 0
174+
step.signatureCount > 0 && requiresSignature
168175
? `Your wallet will prompt you to sign ${
169176
step.signatureCount === 1 ? "the" : step.signatureCount || 1
170177
} transaction${step.signatureCount > 1 ? "s" : ""}.`
@@ -177,7 +184,7 @@ function getStepInfo(step: DeployModalStep): TitleAndDesc {
177184
title: "Setting NFT metadata",
178185
description: (
179186
<>
180-
{step.signatureCount > 0
187+
{step.signatureCount > 0 && requiresSignature
181188
? "Your wallet will prompt you to sign the transaction. "
182189
: "This may take a few seconds."}
183190
</>

0 commit comments

Comments
 (0)