Skip to content

Commit

Permalink
Migrate to Lens v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoginth committed Dec 13, 2024
1 parent e4648b1 commit 43cd89a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions apps/og/src/app/posts/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export const generateMetadata = async ({
const filteredAsset = getPostData(metadata)?.asset;
const assetIsAudio = filteredAsset?.type === "Audio";

const { name, link, slugWithPrefix } = getAccount(author);
const title = `${targetPost.__typename} by ${slugWithPrefix}${APP_NAME}`;
const { name, link, usernameWithPrefix } = getAccount(author);
const title = `${targetPost.__typename} by ${usernameWithPrefix}${APP_NAME}`;
const description = (filteredContent || title).slice(0, 155);

return {
Expand All @@ -69,7 +69,7 @@ export const generateMetadata = async ({
"decentralized",
"web3",
name,
slugWithPrefix
usernameWithPrefix
],
metadataBase: new URL(`https://hey.xyz/posts/${targetPost.id}`),
openGraph: {
Expand Down
6 changes: 3 additions & 3 deletions apps/og/src/app/u/[username]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const generateMetadata = async ({

const account = result.data.profile as Account;
const stats = result.data.accountStats as AccountStats;
const { name, link, slugWithPrefix } = getAccount(account);
const title = `${name} (${slugWithPrefix}) • ${APP_NAME}`;
const { name, link, usernameWithPrefix } = getAccount(account);
const title = `${name} (${usernameWithPrefix}) • ${APP_NAME}`;
const description = (account?.metadata?.bio || title).slice(0, 155);

return {
Expand All @@ -61,7 +61,7 @@ export const generateMetadata = async ({
"decentralized",
"web3",
name,
slugWithPrefix
usernameWithPrefix
],
metadataBase: new URL(`https://hey.xyz${link}`),
openGraph: {
Expand Down
8 changes: 5 additions & 3 deletions apps/web/src/components/Shared/FallbackAccountName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ const FallbackAccountName: FC<FallbackAccountNameProps> = ({
return null;
}

const { name, link, slugWithPrefix } = getAccount(account);
const accountName = account?.metadata?.name || <Slug slug={slugWithPrefix} />;
const { name, link, usernameWithPrefix } = getAccount(account);
const accountName = account?.metadata?.name || (
<Slug slug={usernameWithPrefix} />
);

return (
<>
<Link
aria-label={`Account of ${name || slugWithPrefix}`}
aria-label={`Account of ${name || usernameWithPrefix}`}
className={cn(
"max-w-sm truncate outline-none hover:underline focus:underline",
className
Expand Down

0 comments on commit 43cd89a

Please sign in to comment.