Skip to content

Commit 0f38a12

Browse files
authored
[SDK] Feature: Hide the TransactionWidget contract label if unknown (#7642)
1 parent 61bfebf commit 0f38a12

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

.changeset/whole-bottles-wait.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
TransactionWidget: Hides the "UnknownContract" label

packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -212,22 +212,28 @@ export function TransactionPayment({
212212
<Spacer y="md" />
213213

214214
{/* Contract Info */}
215-
<Container
216-
flex="row"
217-
style={{
218-
alignItems: "center",
219-
justifyContent: "space-between",
220-
}}
221-
>
222-
<Text color="secondaryText" size="sm">
223-
Contract
224-
</Text>
225-
<Text color="primaryText" size="sm">
226-
{contractName}
227-
</Text>
228-
</Container>
229-
230-
<Spacer y="xs" />
215+
{contractName !== "UnknownContract" &&
216+
contractName !== undefined &&
217+
contractName !== "Unknown Contract" && (
218+
<>
219+
<Container
220+
flex="row"
221+
style={{
222+
alignItems: "center",
223+
justifyContent: "space-between",
224+
}}
225+
>
226+
<Text color="secondaryText" size="sm">
227+
Contract
228+
</Text>
229+
<Text color="primaryText" size="sm">
230+
{contractName}
231+
</Text>
232+
</Container>
233+
234+
<Spacer y="xs" />
235+
</>
236+
)}
231237

232238
{/* Address */}
233239
<Container

0 commit comments

Comments
 (0)