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

Use react-query for data fetches #336

Merged
merged 10 commits into from
Aug 25, 2021
Merged

Use react-query for data fetches #336

merged 10 commits into from
Aug 25, 2021

Conversation

onnovisser
Copy link
Collaborator

@onnovisser onnovisser commented Aug 18, 2021

Removes most ducks that were used for data fetching and replace with hook that use react-query to fetch the data. The loans and userRewards ducks are still todo, but will leave those for a later time.

Closes #344

@github-actions
Copy link

github-actions bot commented Aug 23, 2021

🚀 Deployed on https://pr-336--dev-tinlake.netlify.app

@@ -27,7 +28,7 @@ const PoolsMetrics: React.FC<Props> = (props: Props) => {

const maxPoolValue = Math.max.apply(
Math,
poolsDailyData.map((o) => {
dailyTVL.map((o) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

we needa change these one letter variable names soon 🙈

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🙈

@@ -30,15 +32,53 @@ interface Props {

export type Card = 'home' | 'collect' | 'order' | 'invest' | 'redeem'

function useTrancheData(tinlake: ITinlake, tranche: 'senior' | 'junior', address?: string | null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we move this to the hooks folder?

Copy link
Collaborator Author

@onnovisser onnovisser Aug 25, 2021

Choose a reason for hiding this comment

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

Yeah, probably. Or we can combine it with the epoch data hook and make it one multicall to avoid having a bunch of requests.

Copy link
Contributor

@jpangelle jpangelle left a comment

Choose a reason for hiding this comment

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

😱 😱 😱 🔥

@onnovisser onnovisser merged commit 43a7718 into main Aug 25, 2021
@onnovisser onnovisser deleted the react-query branch August 25, 2021 08:25
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.

Potential UI bug displayning CFG Reward rate
2 participants