From adae9f6394e8ee5f039647d3c7f226947c1267f8 Mon Sep 17 00:00:00 2001 From: Paul Cramer Date: Mon, 2 Dec 2024 21:41:51 -0500 Subject: [PATCH 1/2] Better --- src/identity/utils/getSocialPlatformDetails.test.tsx | 2 +- src/identity/utils/getSocialPlatformDetails.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/identity/utils/getSocialPlatformDetails.test.tsx b/src/identity/utils/getSocialPlatformDetails.test.tsx index e5f279a1a4..df16af8478 100644 --- a/src/identity/utils/getSocialPlatformDetails.test.tsx +++ b/src/identity/utils/getSocialPlatformDetails.test.tsx @@ -19,7 +19,7 @@ describe('PLATFORM_CONFIG', () => { it('should generate correct Farcaster URL', () => { const url = PLATFORM_CONFIG.farcaster.href('username'); - expect(url).toBe('username'); + expect(url).toBe('https://warpcast.com/username'); }); it('should return website URL as-is', () => { diff --git a/src/identity/utils/getSocialPlatformDetails.tsx b/src/identity/utils/getSocialPlatformDetails.tsx index 11ff7c7792..66138bf3f2 100644 --- a/src/identity/utils/getSocialPlatformDetails.tsx +++ b/src/identity/utils/getSocialPlatformDetails.tsx @@ -19,7 +19,10 @@ export const PLATFORM_CONFIG: Record< icon: githubSvg, }, farcaster: { - href: (value) => value, + href: (value) => { + const username = value.split('/').pop(); + return `https://warpcast.com/${username}`; + }, icon: warpcastSvg, }, website: { From 6b7eb839ced3af9291743e1cd5c68811852c2053 Mon Sep 17 00:00:00 2001 From: Paul Cramer Date: Mon, 2 Dec 2024 21:46:09 -0500 Subject: [PATCH 2/2] Fix tests --- src/identity/components/Socials.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/identity/components/Socials.test.tsx b/src/identity/components/Socials.test.tsx index f859c68e25..2d8174446f 100644 --- a/src/identity/components/Socials.test.tsx +++ b/src/identity/components/Socials.test.tsx @@ -133,7 +133,7 @@ describe('Socials', () => { ); expect(screen.getByTestId('ockSocials_Farcaster')).toHaveAttribute( 'href', - 'farcasteruser', + 'https://warpcast.com/farcasteruser', ); expect(screen.getByTestId('ockSocials_Website')).toHaveAttribute( 'href',