Skip to content

use resolved ENS name if available #5734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dashboard/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
2 changes: 1 addition & 1 deletion apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "next dev",
"dev": "next dev --turbo",
"build": "NODE_OPTIONS=--max-old-space-size=6144 next build",
"start": "next start",
"format": "biome format ./src --write",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function ProfileUI(props: {

return (
<div className="container pt-8 pb-20">
<ProfileHeader profileAddress={profileAddress} />
<ProfileHeader profileAddress={profileAddress} ensName={ensName} />
<div className="h-8" />

<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import {
} from "thirdweb/react";
import { shortenIfAddress } from "utils/usedapp-external";

export function ProfileHeader(props: { profileAddress: string }) {
export function ProfileHeader(props: {
profileAddress: string;
ensName: string | undefined;
}) {
const client = useThirdwebClient();
return (
<AccountProvider address={props.profileAddress} client={client}>
Expand All @@ -27,17 +30,22 @@ export function ProfileHeader(props: { profileAddress: string }) {
/>
<div>
<h1 className="font-semibold text-4xl tracking-tight">
<AccountName
fallbackComponent={
<AccountAddress
formatFn={(addr) =>
shortenIfAddress(replaceDeployerAddress(addr))
}
/>
}
loadingComponent={<Skeleton className="h-8 w-40" />}
formatFn={(name) => replaceDeployerAddress(name)}
/>
{/* if we already have an ensName just use it */}
{props.ensName ? (
props.ensName
) : (
<AccountName
fallbackComponent={
<AccountAddress
formatFn={(addr) =>
shortenIfAddress(replaceDeployerAddress(addr))
}
/>
}
loadingComponent={<Skeleton className="h-8 w-40" />}
formatFn={(name) => replaceDeployerAddress(name)}
/>
)}
</h1>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default async function Page(props: PageProps) {

return (
<ProfileUI
ensName={resolvedInfo.ensName}
ensName={replaceDeployerAddress(resolvedInfo.ensName || "")}
profileAddress={resolvedInfo.address}
/>
);
Expand Down
Loading