Skip to content

refactor: migrate icons to typescript - #2397

Merged
SgtPooki merged 4 commits into
mainfrom
fix/typescript-icons
Aug 13, 2025
Merged

refactor: migrate icons to typescript#2397
SgtPooki merged 4 commits into
mainfrom
fix/typescript-icons

Conversation

@SgtPooki

@SgtPooki SgtPooki commented Aug 13, 2025

Copy link
Copy Markdown
Member

Migrates all icons to typescript by upgrading svgr and updating parameters so generated icons are in the format we need.

Also:

  1. Updated tsconfig to use 'react' instead of 'react-jsx' since we are on React 16
    • this means we had to import react in a few .tsx files
  2. created a new all.tsx file that exports some custom icons that aren't in the ipfs-css package as well as all exports from index.tsx that svgr generates.
  3. updated the Icons.stories.tsx file to use the new all.tsx file so all icons are available in storybook.

Replaces #2390
PartOf #2349

@SgtPooki
SgtPooki requested a review from a team as a code owner August 13, 2025 17:44

@SgtPooki SgtPooki left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review. git CLI showed these files as renamed and not changed.. github apparently cannot.

@@ -1,5 +1,5 @@
import { CID } from 'multiformats/cid'
import { useState, useEffect, useCallback, type FC } from 'react'
import React, { useState, useEffect, useCallback, type FC } from 'react'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are required to import React as global import in .jsx/.tsx files on react 16

@SgtPooki
SgtPooki merged commit b166caf into main Aug 13, 2025
23 checks passed
@SgtPooki
SgtPooki deleted the fix/typescript-icons branch August 13, 2025 18:23
@ipfs-gui-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 4.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants