Skip to content

Commit

Permalink
Merge pull request #17 from farcasterxyz/horsefacts/link-to-warpcast
Browse files Browse the repository at this point in the history
feat: add external links to warpcast
  • Loading branch information
nickcherry authored Jan 26, 2024
2 parents 1387d9f + cfd439d commit a2a2cd8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion web/src/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const authOptions = {
const verifyResponse = await appClient.verifySignInMessage({
message: credentials!.message as string,
signature: credentials!.signature as `0x${string}`,
domain: "https://localhost:3000",
domain: "example.com",
nonce: credentials!.csrfToken,
});

Expand Down
1 change: 0 additions & 1 deletion web/src/components/avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const fallbackUrl = "/default-avatar.png";
type AvatarProps = {
size?: "sm" | "md" | "lg";
user: User;
pfpDiameter?: number;
};
export function Avatar({ size = "md", user }: AvatarProps) {
const [src, setSrc] = useState(user.pfp_url || fallbackUrl);
Expand Down
22 changes: 19 additions & 3 deletions web/src/components/feed/Cast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,29 @@ type CastProps = {
export function Cast({ cast }: CastProps) {
return (
<div className="flex flex-row gap-2 border-b-gray-200 px-4 py-3 [&:not(:first-child)]:border-t">
<Avatar user={cast.user} />
<a href={`https://warpcast.com/${cast.user.username}`} target="_blank">
<Avatar user={cast.user} />
</a>
<div className="flex flex-col">
<div className="flex flex-row items-center">
<span className="mr-1 font-bold">{cast.user.display_name}</span>
<span className="mr-1 font-bold">
<a
href={`https://warpcast.com/${cast.user.username}`}
target="_blank"
className="hover:underline"
>
{cast.user.display_name}
</a>
</span>
<span className="mr-1 text-gray-500">@{cast.user.username}</span>·
<span className="ml-1 text-gray-500">
{formatDistance(new Date(), cast.timestamp)}
<a
href={`https://warpcast.com/${cast.user.username}/0x${cast.hash}`}
target="_blank"
className="hover:underline"
>
{formatDistance(new Date(), cast.timestamp)}
</a>
</span>
</div>
<div
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function Login() {
relay: "https://relay.farcaster.xyz",
rpcUrl: "https://mainnet.optimism.io",
siweUri: "https://localhost:3000",
domain: "https://localhost:3000",
domain: "example.com",
}}
>
<SignInButton
Expand Down
14 changes: 12 additions & 2 deletions web/src/components/profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ export function Profile({ user }: ProfileProps) {
return (
<div className="flex flex-col p-4">
<div className="flex flex-row place-items-center">
<Avatar user={user} pfpDiameter={72} />
<a href={`https://warpcast.com/${user.username}`} target="_blank">
<Avatar user={user} size="lg" />
</a>
<div className="ml-4 flex flex-col">
<span className="font-bold">{user.display_name}</span>
<span className="font-bold">
<a
href={`https://warpcast.com/${user.username}`}
target="_blank"
className="hover:underline"
>
{user.display_name}
</a>
</span>
<span className="text-gray-500">@{user.username}</span>
<div className="mt-2">
<Linkify>{user.bio}</Linkify>
Expand Down

0 comments on commit a2a2cd8

Please sign in to comment.