Skip to content

Conversation

Jon-edge
Copy link
Collaborator

@Jon-edge Jon-edge commented Sep 9, 2024

image

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

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:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@Jon-edge Jon-edge force-pushed the jon/assetstatuscards2 branch from 3a6b52a to a50668d Compare September 12, 2024 01:47
Copy link
Member

@paullinator paullinator left a 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

@Jon-edge Jon-edge force-pushed the jon/assetstatuscards2 branch 4 times, most recently from cedca72 to 17f9215 Compare September 17, 2024 02:36
Copy link
Member

@paullinator paullinator left a 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) => {
Copy link
Member

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

Copy link
Collaborator Author

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)}`}>
Copy link
Member

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(() => '')
Copy link
Member

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
Copy link
Member

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

Copy link
Member

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

Copy link
Collaborator Author

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.

@Jon-edge Jon-edge force-pushed the jon/assetstatuscards2 branch from b020938 to de15850 Compare September 17, 2024 16:49
@Jon-edge Jon-edge enabled auto-merge September 17, 2024 16:49
@Jon-edge Jon-edge disabled auto-merge September 17, 2024 17:10
@Jon-edge Jon-edge merged commit 993630c into develop Sep 17, 2024
2 checks passed
@Jon-edge Jon-edge deleted the jon/assetstatuscards2 branch September 17, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants