diff --git a/src/app/profile/[handle]/page.test.tsx b/src/app/profile/[handle]/page.test.tsx index 268fb18..71a63b5 100644 --- a/src/app/profile/[handle]/page.test.tsx +++ b/src/app/profile/[handle]/page.test.tsx @@ -103,7 +103,7 @@ describe('UserProfilePage', () => { it('renders Bluesky link', async () => { render() await waitFor(() => { - const link = screen.getByRole('link', { name: /bsky\.app\/profile\/jay\.bsky\.team/i }) + const link = screen.getByRole('link', { name: /bluesky/i }) expect(link).toHaveAttribute('href', 'https://bsky.app/profile/jay.bsky.team') }) }) diff --git a/src/components/icons/bluesky-icon.tsx b/src/components/icons/bluesky-icon.tsx new file mode 100644 index 0000000..9909a81 --- /dev/null +++ b/src/components/icons/bluesky-icon.tsx @@ -0,0 +1,20 @@ +interface BlueskyIconProps { + size?: number + className?: string +} + +export function BlueskyIcon({ size = 16, className }: BlueskyIconProps) { + return ( + + ) +} diff --git a/src/components/profile/profile-header.test.tsx b/src/components/profile/profile-header.test.tsx index 0dd3ba7..24a32be 100644 --- a/src/components/profile/profile-header.test.tsx +++ b/src/components/profile/profile-header.test.tsx @@ -184,17 +184,18 @@ describe('ProfileHeader', () => { expect(screen.getByText(/75 following/i)).toBeInTheDocument() }) - it('renders Bluesky link with stripped URL display when hasBlueskyProfile is true', () => { + it('renders Bluesky icon link when hasBlueskyProfile is true', () => { render() - const link = screen.getByRole('link', { name: /bsky\.app\/profile\/test\.bsky\.social/i }) + const link = screen.getByRole('link', { name: /bluesky/i }) expect(link).toHaveAttribute('href', 'https://bsky.app/profile/test.bsky.social') + expect(link).toHaveAttribute('title', 'View test.bsky.social on Bluesky') }) it('does not render Bluesky link when hasBlueskyProfile is false', () => { render( ) - expect(screen.queryByRole('link', { name: /bsky\.app\/profile/i })).not.toBeInTheDocument() + expect(screen.queryByRole('link', { name: /bluesky/i })).not.toBeInTheDocument() }) it('renders votesReceived in "This forum" stats', () => { diff --git a/src/components/profile/profile-stats.tsx b/src/components/profile/profile-stats.tsx index 752060c..685d295 100644 --- a/src/components/profile/profile-stats.tsx +++ b/src/components/profile/profile-stats.tsx @@ -4,7 +4,8 @@ * @see specs/prd-web.md Section M8 */ -import { Users, ArrowSquareOut, CalendarBlank } from '@phosphor-icons/react' +import { Users, CalendarBlank } from '@phosphor-icons/react' +import { BlueskyIcon } from '@/components/icons/bluesky-icon' import { formatCount } from '@/lib/format-count' import { formatDateLong } from '@/lib/format' import type { UserProfile } from '@/lib/api/types' @@ -49,10 +50,11 @@ export function ProfileStats({ profile, handle }: ProfileStatsProps) { href={`https://bsky.app/profile/${handle}`} target="_blank" rel="noopener noreferrer" - className="mt-1 inline-flex items-center gap-1 break-all text-sm text-primary hover:underline" + className="mt-1 inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-primary" + title={`View ${handle} on Bluesky`} > - bsky.app/profile/{handle} -