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 33/// <reference types="next/navigation-types/compat/navigation" />
44
55// 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 44 "private" : true ,
55 "scripts" : {
66 "preinstall" : " npx only-allow pnpm" ,
7- "dev" : " next dev" ,
7+ "dev" : " next dev --turbo " ,
88 "build" : " NODE_OPTIONS=--max-old-space-size=6144 next build" ,
99 "start" : " next start" ,
1010 "format" : " biome format ./src --write" ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export function ProfileUI(props: {
1414
1515 return (
1616 < div className = "container pt-8 pb-20" >
17- < ProfileHeader profileAddress = { profileAddress } />
17+ < ProfileHeader profileAddress = { profileAddress } ensName = { ensName } />
1818 < div className = "h-8" />
1919
2020 < div >
Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ import {
1212} from "thirdweb/react" ;
1313import { shortenIfAddress } from "utils/usedapp-external" ;
1414
15- export function ProfileHeader ( props : { profileAddress : string } ) {
15+ export function ProfileHeader ( props : {
16+ profileAddress : string ;
17+ ensName : string | undefined ;
18+ } ) {
1619 const client = useThirdwebClient ( ) ;
1720 return (
1821 < AccountProvider address = { props . profileAddress } client = { client } >
@@ -27,17 +30,22 @@ export function ProfileHeader(props: { profileAddress: string }) {
2730 />
2831 < div >
2932 < 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+ ) }
4149 </ h1 >
4250 </ div >
4351 </ div >
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default async function Page(props: PageProps) {
2121
2222 return (
2323 < ProfileUI
24- ensName = { resolvedInfo . ensName }
24+ ensName = { replaceDeployerAddress ( resolvedInfo . ensName || "" ) }
2525 profileAddress = { resolvedInfo . address }
2626 />
2727 ) ;
You can’t perform that action at this time.
0 commit comments