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

feat(wallet): Dune stats #496

Merged
merged 27 commits into from
Dec 6, 2024
Merged

feat(wallet): Dune stats #496

merged 27 commits into from
Dec 6, 2024

Conversation

DiogoSoaress
Copy link
Member

@DiogoSoaress DiogoSoaress commented Nov 20, 2024

What it solves

Fetches Safe numbers from Dune queries

I ended up moving the fetchers outside of the hook.

DiogoSoaress and others added 23 commits August 27, 2024 14:48
* feat: Hero section

* fix: lint

* feat: add "Watch demo" play button

* fix: control video play

* feat: add a bottom gradient over the paused video

* styles: fix border-radius on video

* feat: temporarily use /wallet-new slug because page path  conflct with the current version

* feat: move section content back to the .json file

* fix: restore CenteredTextBlock

* Revert "fix: restore CenteredTextBlock"

This reverts commit f6a463b.
* feat: Hero section

* fix: lint

* feat: add "Watch demo" play button

* fix: control video play

* feat: add a bottom gradient over the paused video

* styles: fix border-radius on video

* feat: temporarily use /wallet-new slug because page path  conflct with the current version

* feat: commonCMS/Marquee

* feat: generic Card grid

* feat: declare content in wallet.json

* fix: undo unrelated change

* fix: do not render the component without `items`

* fix: remove conditional operator
* feat: Hero section

* fix: lint

* feat: add "Watch demo" play button

* fix: control video play

* feat: add a bottom gradient over the paused video

* styles: fix border-radius on video

* feat: temporarily use /wallet-new slug because page path  conflct with the current version

* feat: commonCMS/Marquee

* feat: generic Card grid

* feat: Vertical Slide

* feat: display images when clicking the cards

* fix: lint

* fix: undo unrelated changes

* feat: declare VerticalSlide content in wallet.json

* styles: mobile styles

* fix: extract expression to a variable
* feat: FeatureCards component

* feat: ecosystem projects card

* feat: rest of Featured cards

* feat: cta to wallet app

* Update src/components/Wallet/FeatureCards/index.tsx

Co-authored-by: Aaron Cook <[email protected]>

* Apply suggestions from code review

Co-authored-by: Aaron Cook <[email protected]>

---------

Co-authored-by: Aaron Cook <[email protected]>
* feat: common FAQ section

* feat: import FAQ content from CMS

* fix: undo unrelated changes
* v1.5.7

* feat: Wallet page Vertical stack

* styles: apply styles

* styles: adjust title wrapper width

* Apply suggestions from code review

Co-authored-by: Aaron Cook <[email protected]>

---------

Co-authored-by: Aaron Cook <[email protected]>
* feat: "subscribe to latest" section

* feat: display laptop image

* fix: copy changes
* feat: scroll based animation

* feat: scroll based animation in VerticalStack

* fix: handle card click

* fix: move sticky section to laptop view

* fix: ignore TS line for testing
* styles: center play button

* style: fix logos

* style: address comments on sections margins

* style: center Watch Demo button

* fix: consistent CTA copy

* style: increase card padding

* fix: stretched images

* fix: update starknet logo

* feat: replace assets
Copy link

github-actions bot commented Nov 20, 2024

Branch preview

✅ Deployed successfully in branch deployment:

https://wallet_dune_links--homepage.review.5afe.dev

@@ -31,12 +34,25 @@ export const fetchTotalSafesDeployed = async (): Promise<number | null> => {
.catch(() => null)
}

export const fetchMonthlyActiveUsers = async (): Promise<number | null> => {
return fetch(duneQueryUrlBuilder(QUERY_ID_MONTHLY_ACTIVE_USERS, DUNE_API_KEY))
.then((res) => res.json())
Copy link
Member

Choose a reason for hiding this comment

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

The res may be erroneous. We should check that res.ok before returning the JSON.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added to the other fetchers as well.

Comment on lines 52 to 57
return [
formattedTotalTransactions,
formattedTotalBalanceUsd,
formattedTotalSafesDeployed,
formattedMonthlyActiveUsers,
]
Copy link
Member

Choose a reason for hiding this comment

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

Nit: it's easy to access the wrong index. What do you think about returning an object instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Followed the recommendation 👍

Comment on lines 14 to 16
const dataRoomStats = await fetchDataRoomStats()
const totalBalanceUsd = await fetchTotalBalanceUsd()
const monthlyActiveUsers = await fetchMonthlyActiveUsers()
Copy link
Member

Choose a reason for hiding this comment

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

We could make these a single promise with Promise.all.

.then((data) => data.result.rows[data.result.rows.length - 1].active_users)
.catch(() => null)
}

export const useSafeStats = (): Array<string | null> => {
Copy link
Member

Choose a reason for hiding this comment

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

Have you thought about using swr for this hook? We'd not need a context.

Base automatically changed from wallet-landing-page to main November 25, 2024 14:33
@DiogoSoaress DiogoSoaress requested a review from iamacook December 6, 2024 11:17
@DiogoSoaress DiogoSoaress merged commit cb37dac into main Dec 6, 2024
4 checks passed
@DiogoSoaress DiogoSoaress deleted the wallet-dune-links branch December 6, 2024 13:48
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants