Skip to content

Commit 49c4e59

Browse files
authored
chore: Improve <Socials /> Farcaster URL processing (#1688)
1 parent bae7ec6 commit 49c4e59

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/identity/components/Socials.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ describe('Socials', () => {
133133
);
134134
expect(screen.getByTestId('ockSocials_Farcaster')).toHaveAttribute(
135135
'href',
136-
'farcasteruser',
136+
'https://warpcast.com/farcasteruser',
137137
);
138138
expect(screen.getByTestId('ockSocials_Website')).toHaveAttribute(
139139
'href',

src/identity/utils/getSocialPlatformDetails.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('PLATFORM_CONFIG', () => {
1919

2020
it('should generate correct Farcaster URL', () => {
2121
const url = PLATFORM_CONFIG.farcaster.href('username');
22-
expect(url).toBe('username');
22+
expect(url).toBe('https://warpcast.com/username');
2323
});
2424

2525
it('should return website URL as-is', () => {

src/identity/utils/getSocialPlatformDetails.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ export const PLATFORM_CONFIG: Record<
1919
icon: githubSvg,
2020
},
2121
farcaster: {
22-
href: (value) => value,
22+
href: (value) => {
23+
const username = value.split('/').pop();
24+
return `https://warpcast.com/${username}`;
25+
},
2326
icon: warpcastSvg,
2427
},
2528
website: {

0 commit comments

Comments
 (0)