-
Notifications
You must be signed in to change notification settings - Fork 29
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: add new Asset component #314
Conversation
export const assets: AssetList = { | ||
eth: { | ||
symbol: 'ETH', | ||
name: 'Ethereum', | ||
imageUrl: '/assets/eth.svg', | ||
}, | ||
}; |
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.
We should not include this here, but instead, we can receive a JSON with these configs on the application level. This is because we will need an asset package with only asset information and images, that will contain more information.
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.
✅
Coverage report
Test suite run success197 tests passing in 49 suites. Report generated by 🧪jest coverage report action from b1ede38 |
import type { ReactNode } from 'react'; | ||
import { Children } from 'react'; | ||
|
||
export function useStrictedChildren( |
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.
This looks like something that could affect the performance of the application. As if create arrays on every execution, and not caches anything. What do you think?
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.
hm, I guess isn't a big thing, but I just added two useMemo
to prevent head
and last
from being on every render and added the check inside an useEffect. We already have other children map
operations inside components, which isn't something so unusual in fact.
1793d71
to
b087178
Compare
b087178
to
8694d2c
Compare
This pull request intends to add a new component called
Asset
to handle different scenarios using visual information related to assets across all applications.Usage
Works as a namespace component, using context to set data, and just using the child component to manage UI.
This code will render a component like this:
You can see other variations that are possible to create inside the Asset story.