-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: be possible to customize placeholder #278
base: master
Are you sure you want to change the base?
Conversation
packages/react/src/index.js
Outdated
@@ -39,6 +39,7 @@ const Card = props => { | |||
setData, | |||
url, | |||
apiKey, // destructuring to avoid pass it | |||
placeholderComponent: CardEmpty, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what could be the right naming for this:
- placeholderComponent
- skeletonComponent
- loadingComponent
I think *Component
suffix is important to don't confuse it with a regular API parameter option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another structure for this sort of situation is a components
prop, that receives an object where the keys are the component names in PascalCase (this is how react-select
handles things).
components={{ PlaceholderComponent: Foo }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me @Kikobeats, just a couple of questions:
- Regarding adding the
microlink_card_placeholder
className to all placeholder elements. Maybe we should vary it, or add some "secondary" className to easily identify each part of the placeholder. - Should we be adding a classname to the media whilst it's in placeholder mode?
- You're not actually using the
placeholderComponent
prop it seems, is that intentional?
Hey @Kikobeats, what do you think of this implementation? Personally after reviewing it again on GH I think I'd prefer a name such as Thanks
|
+ Add new prop for injecting custom loading component + Update stories
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This PR contains two things:
demo
closes #249