Skip to content

Conversation

@rossbulat
Copy link
Contributor

@rossbulat rossbulat commented Nov 2, 2024

This PR completely rewrites the @w3ux/react-polkicon package, reducing boilerplate, improving readability, and addressing various issues from the previous version.

Major Enhancements

  • Fixes an issue where the generated colors were not inline with other platforms like Subscan.
  • Completely does away with a size prop in favour of inheriting the nearest element with fontSize assigned, acting more like an inline icon.
  • Removes copy functionality completely, giving the Dapp responsibility to implement copy functionality if needed.
  • Removes @polkadot/util-crypto in favour of @w3ux/crypto exporting the light weight crypto utility required for Polkicon. Also uses @polkadot-api/substrate-bindings for codecs where needed.
  • Completely refactors the Polkicon SCHEMA object and rotation configs taken from JS Apps, making these objects and utility functions more readable and understandable.
  • Adds comprehensive comments to each function, accompanied with inline commenting.
  • Abstracts and improves types.
  • Removes unnecessary expressions carried over from JS Apps that were not relevant to this lightweight Polkicon implementation & that were previously not removed.
  • Stopped the package from throwing any errors.
  • Simplifies syntax and reduces boilerplate throughout for improved conciseness.

The package is now a well-structured, minimal UI component that Dapps can easily leverage. Significant improvements to the syntax have enhanced readability and maintainability, transforming the codebase from its previously complex and confusing state.

@rossbulat rossbulat changed the title feat: Rewrite and improve @w3ux/react-polkicon feat: Rewrite and improve Polkicon - @w3ux/react-polkicon Nov 2, 2024
@rossbulat rossbulat merged commit b16c7e7 into main Nov 2, 2024
@rossbulat rossbulat deleted the rb-refresh-polkicon branch November 2, 2024 11:59
@rossbulat rossbulat self-assigned this Nov 2, 2024
@rossbulat rossbulat mentioned this pull request Nov 2, 2024
This was referenced Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants