-
Notifications
You must be signed in to change notification settings - Fork 275
Change assetStatusCards to the new assetStatusCards2 from info server #5239
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
Conversation
3a6b52a
to
a50668d
Compare
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.
Do not merge. This PR is completely misses the spec of the task
cedca72
to
17f9215
Compare
17f9215
to
30527ff
Compare
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.
Added a fixup but it's not tested. Please test and merge if it works
|
||
export const PromoCards = (props: Props) => { | ||
const { countryCode, navigation, screenWidth } = props | ||
export const InfoCardCarousel = (props: Props) => { |
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.
Danger. Don't rename the file AND make changes in the same commit. Many times git can't tell it was a rename and you'll have a diff that shows a file deletion and file creation making a near impossible review. It happened to work out in this case
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.
I saw the diff worked out, or else I would have separated the commits. Will
default to separating to be safe in the future
/> | ||
{assetStatuses.length > 0 && !isSearching | ||
? assetStatuses.map(assetStatus => ( | ||
<EdgeAnim enter={fadeInDown10} key={`${String(assetStatus.localeStatusTitle)}-${String(assetStatus.localeStatusBody)}`}> |
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.
The fadeInDown10
was effectively replaced by fadeInUp110
which is baked into the carousel. This needs to be pulled out of the carousel and used in the parent component.
|
||
const handleCreateWallet = useHandler(async (walletId: string, tokenId: EdgeTokenId) => { | ||
const wallet = account.currencyWallets[walletId] | ||
const countryCode = await getCountryCodeByIp().catch(() => '') |
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.
For another PR: Need to always return undefined
if we can't get the countryCode. Otherwise the filter will think the countryCode is a blank string and the excludeCountryCodes will fail. This needs to change everywhere we call getCountryCodeByIp
export const PromoCards = (props: Props) => { | ||
const { countryCode, navigation, screenWidth } = props | ||
export const InfoCardCarousel = (props: Props) => { | ||
const { countryCode, navigation, screenWidth, cards = [] } = props |
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.
Yikes! danger, setting a default cards = []
will cause an infinite loop if props.cards is undefined.
That's because you depend on cards
in the useEffect below which then causes a re-render since you call setFilteredCards which will create a new cards
array causing useEffect to get called again. And repeat forever
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.
Just accept an undefined and handle it in the useEffect
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.
Didn't realize that can trigger an infinite loop. Tested behavior before and
after the fix and it checks out.
b020938
to
de15850
Compare
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
https://github.com/EdgeApp/edge-info-server/pull/131
Requirements
If you have made any visual changes to the GUI. Make sure you have: