Skip to content
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

Claimables: query + wallet screen ui #6071

Merged
merged 15 commits into from
Sep 12, 2024

Conversation

benisgold
Copy link
Member

@benisgold benisgold commented Sep 3, 2024

Fixes APP-####

What changed (plus any additional context for devs)

built out react query infra for addys claimables endpoint + wallet screen ui. locked behind feature flag

also created resources/addys directory, would like to clean up positions/assets queries in the future and consolidate them here since they have overlapping types bc they all rely on addys

Screen recordings / screenshots

Simulator Screenshot - iPhone 15 Pro - 2024-09-03 at 15 38 40

What to test

you can check figma here: https://www.figma.com/design/BqH9Y7pC6zOjO3UrwTBTbL/claimables?node-id=0-1&m=dev

@benisgold benisgold requested a review from walmat September 3, 2024 19:48
Copy link
Contributor

@walmat walmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nitpicks, but lgtm

@brunobar79
Copy link
Member

Launch in simulator or device for bfbc032

@jinchung jinchung removed their request for review September 5, 2024 18:37
}
);

const [claimable] = data;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we planning to have multiple claimables here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

Comment on lines +52 to +63
if (data.metadata.status !== 'ok') {
logger.error(new RainbowError('[userAssetsQueryFunction]: Failed to fetch user assets (API error)'), {
message: data.metadata.errors,
});
}

return parseClaimables(data.payload.claimables, currency);
} catch (e) {
logger.error(new RainbowError('[userAssetsQueryFunction]: Failed to fetch user assets (client error)'), {
message: (e as Error)?.message,
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when data.metadata.status !== 'ok' will we have a data.payload.claimables? just to be sure it wont log like (API error) and then right after (client error) because it couldn't access payload.claimables

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question, i believe data.payload.claimables should always be at least an empty array, according to the addys backend types

Comment on lines 48 to +49
usePositions({ address: accountAddress, currency: nativeCurrency });
useClaimables({ address: accountAddress, currency: nativeCurrency });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add { notifyOnChangeProps: [] } to these queries to avoid rerendering this whole screen when it refetches or is it supposed to?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont think it triggers a rerender bc the return value of useClaimables is not stored

@brunobar79
Copy link
Member

Launch in simulator or device for 9b488a9

@benisgold benisgold merged commit 947b99d into develop Sep 12, 2024
8 checks passed
@benisgold benisgold deleted the @benisgold/claimables-wallet-screen branch September 12, 2024 13:28
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.

4 participants