Giter VIP home page Giter VIP logo

Comments (5)

christopherafbjur avatar christopherafbjur commented on August 18, 2024 1

This plugin is intended for sanity only but I guess it wouldn't hurt to expose the preview function so it could be used in external apps/projects aswell. Will have a look at it asap @fabien

from sanity-plugin-icon-picker.

fabien avatar fabien commented on August 18, 2024

Thanks @christopherafbjur - this is really helpful!

I see that the integration with Sanity is really straightforward now. What about other React apps like a front-end/website? I presume I can simply import preview from 'sanity-plugin-icon-picker/dist/utils/public/preview'? Would you consider adding an export in https://github.com/christopherafbjur/sanity-plugin-icon-picker/blob/main/src/index.js for that?

from sanity-plugin-icon-picker.

christopherafbjur avatar christopherafbjur commented on August 18, 2024

Had a look at this and it does not seem optimal to add a exported preview function (for usage from external react projects) like you request since we're importing components in index.js from the Sanity scope etc using the parts system (these will not be available outside the scope of a sanity project)

Since the provider and name are stored in the icon object, this data can be used in your front-end/website together with some logic (if using multiple providers) to render the correct component from the icon libraries you're using. How ever I agree that it would be optimal to have a function such as the preview function do that for you automatically, just not sure if that is the responsibility of this plugin @fabien

from sanity-plugin-icon-picker.

fabien avatar fabien commented on August 18, 2024

Hi @christopherafbjur. I understand, when it comes to the dependency on the parts system, it doesn't make much sense. Although it is probably also possible to pull those Sanity-specific icons in using a normal dependency.

Not a big issue though, thanks for having a look at this!

from sanity-plugin-icon-picker.

christopherafbjur avatar christopherafbjur commented on August 18, 2024

Hi @fabien ! Hmm I think what you mean is pull the Sanity-specific "parts" using a normal dependency? If that's what you mean that would require us to add sanity as an extra dependency of this project, which would not be optimal for external usage nor "internal".

Let me know if you have any ideas on how to get around this in some other way though @fabien and I'll have a look. Closing for now

from sanity-plugin-icon-picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.