Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
small sdk bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kevoconnell committed Jul 2, 2024
1 parent 942c0a9 commit 334c24a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/app/[identifier]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ export default function Page({ params }: ResponseProps) {
const { author: warpcastAuthor, cast: warpcastCast } = warpcast || {};
const { author: neynarAuthor, cast: neynarCast } = neynar || {};

const authorFid = warpcastCast?.author?.fid || neynarCast?.cast?.author?.fid;
const authorFidCast =
warpcastCast?.author?.fid || neynarCast?.cast?.author?.fid;
const authorFid =
warpcastCast?.author?.fid ||
neynarCast?.cast?.author?.fid ||
neynarAuthor?.author?.fid ||
warpcastAuthor?.author?.fid;

const renderHeader = (
label: string,
Expand Down Expand Up @@ -222,12 +228,12 @@ export default function Page({ params }: ResponseProps) {
</Button>
) : null}

{authorFid ? (
{authorFidCast ? (
<Button
asChild
className="mb-10 min-h-10 px-4 py-2 bg-purple-500 text-white hover:bg-purple-700 rounded-lg"
>
<Link href={`/${authorFid}`}>
<Link href={`/${authorFidCast}`}>
<UserIcon className="w-4 h-4 mr-1" /> View Author Profile
</Link>
</Button>
Expand Down Expand Up @@ -278,8 +284,8 @@ export default function Page({ params }: ResponseProps) {
type={isValidWarpcastUrl(identifier) ? 'url' : 'hash'}
identifier={identifier}
/>
) : fid ? (
<NeynarProfileCard fid={fid} />
) : authorFid ? (
<NeynarProfileCard fid={authorFid} />
) : null}
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/components/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function Home() {
<p className="text-center">Example Warpcast profile url</p>
<div className="h-30 w-full flex justify-center items-center">
<Link
href={`/${warpcastURLProfile}`}
href={`/${encodeURIComponent(warpcastURLProfile)}`}
className="w-full h-full flex justify-center items-center"
>
<NeynarProfileCard fid={616} />
Expand Down

0 comments on commit 334c24a

Please sign in to comment.