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

Extract the dropdown menu from VRF v2 cost calculator #1446

Merged
merged 25 commits into from
Sep 6, 2023

Conversation

simkasss
Copy link
Contributor

@simkasss simkasss commented Aug 8, 2023

Relates issues

Relates #1423

Description

The dropdown menu is extracted from the VRF v2 cost calculator in order to make it reusable in other components.

Changes

  • The dropdown menu is extracted to separate component
  • The dropdown menu is refactored to use the same chain data source as data feeds
  • Add queryString parameter to networks data, in order to easier create and access search parameters
  • Add getNetworkFromQueryString function, in order to get chain network object from search parameters
  • Use useQueryString, in order to get information about selected chain and network from url
  • Update useQueryString to use URLSearchParams instead of query-string, because URLSearchParams is built-in

@vercel
Copy link

vercel bot commented Aug 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 6, 2023 4:17pm

yacine-benichou
yacine-benichou previously approved these changes Aug 9, 2023
Copy link
Contributor

@yacine-benichou yacine-benichou left a comment

Choose a reason for hiding this comment

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

Good job on this ! I cleaned some components and used the network queryString unused in the dropdown component to get the last network selected on load and on reload of the page. I left a comment about this. Let me know when I can merge !

@dwightjl dwightjl merged commit 2a1f18c into smartcontractkit:main Sep 6, 2023
2 checks passed
@dwightjl dwightjl mentioned this pull request Sep 6, 2023
dorianbayart pushed a commit to dorianbayart/documentation that referenced this pull request Dec 25, 2023
…it#1446)

* extract-dropdown

* remove mainChainName useState

* improve useQueryString hook

* improve getNetworkFromQueryString

* return null

* Remove useless DropdownMenu component + fill dropdown input with latest selected network on reload

* Refactor CostTable component to fix bugs in getting state values

* Fix bug where API call was made with undefined or null input

* Add additional states to reducer state to have a single source of truth

* Implement throttle for API calls

* Remove logging

* WIP to fix API call rate limit bug

* Fixed issue where loading text did not appear when a network was selected for the first time + Added condition to render costTable only when network is defined

* Use env variables to get VRF calculator API url + clean code

* Remove comments in methodCheckbox component

* Fix type errors in CostTable.test.ts file

* Empty commit

* account test

* new email set

* empty commit

* Empty commit

* Use env variable in costTable test file

* Remove env variable use

* fix lint issue

* Update src/features/data/chains.ts

---------

Co-authored-by: Yacine Benichou <[email protected]>
Co-authored-by: Yacine Benichou <[email protected]>
Co-authored-by: Yacine Benichou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants