teaguestockwell / react-icon-cloud

React component for rendering an interactive img or word cloud on canvas
MIT License
38 stars 4 forks source link

CSR component for simple-icons #1

Closed teaguestockwell closed 2 years ago

teaguestockwell commented 2 years ago

The current implementation of IconCloud must be passed an array of simple icons. The entire simple-icons lib can be imported on the server with Nextjs, but that package is to big to import on the client with CRA.

Given

A new component to handle dynamic client side icon rendering,

When

passed an array of slugs,

Then

  1. for each slug it will GET https://cdn.jsdelivr.net/npm/simple-icons@v5/icons/SLUG.svg
  2. It will GET https://raw.githubusercontent.com/simple-icons/simple-icons/develop/_data/simple-icons.json for the icon's color
  3. It will dynamically fallback to the provided color if the default color does not satisfy the contrast ratio
  4. It will render the icons