1
1
"use client" ;
2
2
3
+ import { ExternalLinkIcon } from "lucide-react" ;
3
4
import Link from "next/link" ;
4
5
import { type ThirdwebClient , ZERO_ADDRESS } from "thirdweb" ;
5
6
import {
@@ -9,7 +10,6 @@ import {
9
10
AccountName ,
10
11
AccountProvider ,
11
12
} from "thirdweb/react" ;
12
- import { Button } from "@/components/ui/button" ;
13
13
import { Skeleton } from "@/components/ui/skeleton" ;
14
14
import { useEns } from "@/hooks/contract-hooks" ;
15
15
import { replaceDeployerAddress } from "@/lib/publisher-utils" ;
@@ -29,57 +29,63 @@ export const PublisherHeader: React.FC<PublisherHeaderProps> = ({
29
29
} ) ;
30
30
31
31
return (
32
- < div className = "flex w-full flex-col gap-4" >
33
- < h4 className = "font-semibold text-lg tracking-tight" > Published by</ h4 >
34
-
32
+ < div >
33
+ < h4 className = "font-medium text-base mb-3" > Published by</ h4 >
35
34
< AccountProvider
36
35
// passing zero address during loading time to prevent the component from crashing
37
36
address = { ensQuery . data ?. address || ZERO_ADDRESS }
38
37
client = { client }
39
38
>
40
- < div className = "relative flex items-center gap-3" >
41
- < AccountAvatar
42
- className = "size-10 rounded-full border border-border border-solid object-cover"
43
- fallbackComponent = {
44
- < AccountBlobbie className = "size-10 rounded-full" />
45
- }
46
- loadingComponent = { < Skeleton className = "size-10 rounded-full" /> }
47
- />
48
-
49
- < Link
50
- className = "before:absolute before:inset-0 hover:underline"
51
- href = { replaceDeployerAddress (
52
- `/${ ensQuery . data ?. ensName || wallet } ` ,
53
- ) }
54
- rel = "noopener noreferrer"
55
- target = "_blank"
56
- >
57
- < AccountName
58
- className = "font-medium"
39
+ < div className = "flex items-center gap-3 relative" >
40
+ < div className = "translate-y-0.5" >
41
+ < AccountAvatar
42
+ className = "size-[34px] rounded-full border border-border border-solid object-cover"
59
43
fallbackComponent = {
60
- // When social profile API support other TLDs as well - we can remove this condition
61
- ensQuery . data ?. ensName ? (
62
- < span > { ensQuery . data ?. ensName } </ span >
63
- ) : (
64
- < AccountAddress
65
- formatFn = { ( addr ) =>
66
- shortenIfAddress ( replaceDeployerAddress ( addr ) )
67
- }
68
- />
69
- )
44
+ < AccountBlobbie className = "size-[34px] rounded-full" />
45
+ }
46
+ loadingComponent = {
47
+ < Skeleton className = "size-[34px] rounded-full" />
70
48
}
71
- formatFn = { ( name ) => replaceDeployerAddress ( name ) }
72
- loadingComponent = { < Skeleton className = "h-8 w-40" /> }
73
49
/>
74
- </ Link >
50
+ </ div >
51
+
52
+ < div className = "space-y-1" >
53
+ < Link
54
+ className = "hover:underline leading-none before:absolute before:inset-0"
55
+ href = { replaceDeployerAddress (
56
+ `/${ ensQuery . data ?. ensName || wallet } ` ,
57
+ ) }
58
+ rel = "noopener noreferrer"
59
+ target = "_blank"
60
+ >
61
+ < AccountName
62
+ className = "text-base leading-none font-medium"
63
+ fallbackComponent = {
64
+ // When social profile API support other TLDs as well - we can remove this condition
65
+ ensQuery . data ?. ensName ? (
66
+ < span className = "text-base leading-none font-medium" >
67
+ { ensQuery . data ?. ensName }
68
+ </ span >
69
+ ) : (
70
+ < AccountAddress
71
+ formatFn = { ( addr ) =>
72
+ shortenIfAddress ( replaceDeployerAddress ( addr ) )
73
+ }
74
+ />
75
+ )
76
+ }
77
+ formatFn = { ( name ) => replaceDeployerAddress ( name ) }
78
+ loadingComponent = { < Skeleton className = "h-6 w-40" /> }
79
+ />
80
+ </ Link >
81
+
82
+ < span className = "text-sm text-muted-foreground flex items-center gap-1.5 leading-none" >
83
+ View all published contracts{ " " }
84
+ < ExternalLinkIcon className = "size-3 text-muted-foreground" />
85
+ </ span >
86
+ </ div >
75
87
</ div >
76
88
</ AccountProvider >
77
-
78
- < Button asChild className = "bg-card" variant = "outline" >
79
- < Link href = { replaceDeployerAddress ( `/${ wallet } ` ) } >
80
- View all contracts
81
- </ Link >
82
- </ Button >
83
89
</ div >
84
90
) ;
85
91
} ;
0 commit comments