1
+ "use client" ;
1
2
import {
2
3
ExternalLinkIcon ,
3
4
GlobeIcon ,
@@ -8,6 +9,7 @@ import Link from "next/link";
8
9
import { useMemo } from "react" ;
9
10
import { type ThirdwebContract , ZERO_ADDRESS } from "thirdweb" ;
10
11
import type { ChainMetadata } from "thirdweb/chains" ;
12
+ import { useActiveAccount } from "thirdweb/react" ;
11
13
import { Img } from "@/components/blocks/Img" ;
12
14
import { Button } from "@/components/ui/button" ;
13
15
import { CopyAddressButton } from "@/components/ui/CopyAddressButton" ;
@@ -64,6 +66,7 @@ export function ContractHeaderUI(props: {
64
66
65
67
return socialUrlsValue ;
66
68
} , [ props . socialUrls ] ) ;
69
+ const activeAccount = useActiveAccount ( ) ;
67
70
68
71
const cleanedChainName = props . chainMetadata ?. name
69
72
?. replace ( "Mainnet" , "" )
@@ -169,29 +172,32 @@ export function ContractHeaderUI(props: {
169
172
variant = "outline"
170
173
/>
171
174
172
- < ToolTipLabel
173
- contentClassName = "max-w-[300px]"
174
- label = {
175
- < >
176
- View this contract in thirdweb dashboard to view contract
177
- management interface
178
- </ >
179
- }
180
- >
181
- < Button
182
- asChild
183
- className = "rounded-full bg-card gap-1.5 text-xs py-1.5 px-2.5 h-auto"
184
- size = "sm"
185
- variant = "outline"
175
+ { props . contractCreator ?. toLowerCase ( ) ===
176
+ activeAccount ?. address ?. toLowerCase ( ) && (
177
+ < ToolTipLabel
178
+ contentClassName = "max-w-[300px]"
179
+ label = {
180
+ < >
181
+ View this contract in thirdweb dashboard to view contract
182
+ management interface
183
+ </ >
184
+ }
186
185
>
187
- < Link
188
- href = { `/team/~/~/contract/${ props . chainMetadata . slug } /${ props . clientContract . address } ` }
186
+ < Button
187
+ asChild
188
+ className = "rounded-full bg-card gap-1.5 text-xs py-1.5 px-2.5 h-auto"
189
+ size = "sm"
190
+ variant = "outline"
189
191
>
190
- < Settings2Icon className = "size-3.5 text-muted-foreground" />
191
- Manage Contract
192
- </ Link >
193
- </ Button >
194
- </ ToolTipLabel >
192
+ < Link
193
+ href = { `/team/~/~/contract/${ props . chainMetadata . slug } /${ props . clientContract . address } ` }
194
+ >
195
+ < Settings2Icon className = "size-3.5 text-muted-foreground" />
196
+ Manage Contract
197
+ </ Link >
198
+ </ Button >
199
+ </ ToolTipLabel >
200
+ ) }
195
201
196
202
{ validBlockExplorer && (
197
203
< BadgeLink
0 commit comments