Skip to content

Conversation

SAHU-01
Copy link
Contributor

@SAHU-01 SAHU-01 commented Sep 28, 2025

Refactored code for #2388 - Cid component TypeScript migration

Changes

  • Added src/components/cid/cid.tsx (functional TSX component with React.forwardRef support)
  • Deleted legacy src/components/cid/Cid.js
  • Converted Storybook to TS: cid.stories.ts with proper Meta/StoryObj typing
  • Exported interface CidProps for external type usage
  • Updated helper functions cidStartAndEnd() and shortCid() with proper TypeScript signatures
  • Fixed value handling to support both strings and objects with toString() method
  • Updated imports in dependent files to use new path: ../cid/cid.js
  • Updated tsconfig.json includes for new .tsx/story files

Tests

  • TypeScript compilation: No errors (npx tsc --noEmit)
  • Lint: No issues (npm run lint)
  • Storybook stories:
    -> CidV0: Displays truncated CID format QmYP…zKkW
    -> CidV0Identicon: Shows identicon + truncated CID
    -> CidV1: Correctly truncates V1 CID zb2r…VCxG
    -> CidV1Sha3: Handles long CID zB7N…hP9Y
  • App functionality: No issues

Dependencies

This PR includes the Identicon TypeScript migration (commits 24360a3, e61dcb4) as Cid component depends on it.

Reviewer: @SgtPooki

@SAHU-01 SAHU-01 requested a review from a team as a code owner September 28, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant