[#116] Extract truncateAddress to shared utility#118
Conversation
Move duplicated truncateAddress() from ConnectWallet, StoryCard, RatingWidget, and story page into lib/utils.ts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The PR cleanly extracts truncateAddress into a shared utility and updates all current call sites without changing behavior. The change is minimal, matches issue #116, and CI passed.
Findings
- None.
Decision
Approve because the refactor is focused, follows existing patterns, and satisfies the acceptance criteria with passing checks.
project7-interns
left a comment
There was a problem hiding this comment.
T2b Review: APPROVE
Clean mechanical extraction — function body is identical across all 4 originals, import paths match existing conventions (verified against sibling imports like ../../lib/rpc and ../../../../lib/price), all duplicate definitions removed, TypeScript types preserved. No logic changes. +7/-16, minimal diff.
One non-blocking note: lib/utils.ts is generic — if more utilities land here, consider more specific module names. Fine for now with a single function.
Summary
truncateAddress()from 4 files (ConnectWallet.tsx,StoryCard.tsx,RatingWidget.tsx,story/[storylineId]/page.tsx) intolib/utils.tsFixes #116
Test plan
npm run lintpassesnpm run typecheckpasses🤖 Generated with Claude Code