File tree Expand file tree Collapse file tree 5 files changed +24
-16
lines changed
src/app/(dashboard)/profile/[addressOrEns] Expand file tree Collapse file tree 5 files changed +24
-16
lines changed Original file line number Diff line number Diff line change 3
3
/// <reference types="next/navigation-types/compat/navigation" />
4
4
5
5
// NOTE: This file should not be edited
6
- // see https://nextjs.org/docs/app/building-your-application/configuring /typescript for more information.
6
+ // see https://nextjs.org/docs/app/api-reference/config /typescript for more information.
Original file line number Diff line number Diff line change 4
4
"private" : true ,
5
5
"scripts" : {
6
6
"preinstall" : " npx only-allow pnpm" ,
7
- "dev" : " next dev" ,
7
+ "dev" : " next dev --turbo " ,
8
8
"build" : " NODE_OPTIONS=--max-old-space-size=6144 next build" ,
9
9
"start" : " next start" ,
10
10
"format" : " biome format ./src --write" ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export function ProfileUI(props: {
14
14
15
15
return (
16
16
< div className = "container pt-8 pb-20" >
17
- < ProfileHeader profileAddress = { profileAddress } />
17
+ < ProfileHeader profileAddress = { profileAddress } ensName = { ensName } />
18
18
< div className = "h-8" />
19
19
20
20
< div >
Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ import {
12
12
} from "thirdweb/react" ;
13
13
import { shortenIfAddress } from "utils/usedapp-external" ;
14
14
15
- export function ProfileHeader ( props : { profileAddress : string } ) {
15
+ export function ProfileHeader ( props : {
16
+ profileAddress : string ;
17
+ ensName : string | undefined ;
18
+ } ) {
16
19
const client = useThirdwebClient ( ) ;
17
20
return (
18
21
< AccountProvider address = { props . profileAddress } client = { client } >
@@ -27,17 +30,22 @@ export function ProfileHeader(props: { profileAddress: string }) {
27
30
/>
28
31
< div >
29
32
< h1 className = "font-semibold text-4xl tracking-tight" >
30
- < AccountName
31
- fallbackComponent = {
32
- < AccountAddress
33
- formatFn = { ( addr ) =>
34
- shortenIfAddress ( replaceDeployerAddress ( addr ) )
35
- }
36
- />
37
- }
38
- loadingComponent = { < Skeleton className = "h-8 w-40" /> }
39
- formatFn = { ( name ) => replaceDeployerAddress ( name ) }
40
- />
33
+ { /* if we already have an ensName just use it */ }
34
+ { props . ensName ? (
35
+ props . ensName
36
+ ) : (
37
+ < AccountName
38
+ fallbackComponent = {
39
+ < AccountAddress
40
+ formatFn = { ( addr ) =>
41
+ shortenIfAddress ( replaceDeployerAddress ( addr ) )
42
+ }
43
+ />
44
+ }
45
+ loadingComponent = { < Skeleton className = "h-8 w-40" /> }
46
+ formatFn = { ( name ) => replaceDeployerAddress ( name ) }
47
+ />
48
+ ) }
41
49
</ h1 >
42
50
</ div >
43
51
</ div >
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default async function Page(props: PageProps) {
21
21
22
22
return (
23
23
< ProfileUI
24
- ensName = { resolvedInfo . ensName }
24
+ ensName = { replaceDeployerAddress ( resolvedInfo . ensName || "" ) }
25
25
profileAddress = { resolvedInfo . address }
26
26
/>
27
27
) ;
You can’t perform that action at this time.
0 commit comments