Comments (5)
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.
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.
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.
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.
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)
- Icons are a bit cut of HOT 2
- DeprecationWarning: Invalid `main` field HOT 4
- Sanity V3 Upgrade? HOT 9
- Output format for react does not work in V3 HOT 4
- Next.js embedded Studio: Global CSS cannot be imported from within node_modules. HOT 2
- Deploying NextJS embedded studio breaks studio HOT 1
- Don't show tabs if only one provider is set
- Global css cannot be imported from within node_modules error HOT 5
- Large front-end bundles? HOT 17
- Stored SVG is not available in GraphQL HOT 5
- Building Next.js app with nested Sanity Studio is broken by the plugin HOT 2
- Application error: a client-side exception has occurred (see the browser console for more information). HOT 2
- Preview module does not work with custom providers HOT 2
- Using custom provider breaks sanity codegen HOT 2
- Error on production and built but not on development HOT 1
- Support for font awesome 6 HOT 1
- Read-only field HOT 7
- Tree shaking is not possible HOT 4
- Icons are cut off in MenuButton
- Translate the strings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sanity-plugin-icon-picker.