-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor useMainProcess #324
Refactor useMainProcess #324
Conversation
…-24-09-18 Release polygon prototype 24 09 18
Release polygon prototype 24 09 25
Create production release
Create new production release
Create new production release
Create new production release
Push latest vortex changes to production.
Create new production release
Create new production release
Hotfix: Update the Mykobo home domain
Create a new production release
✅ Deploy Preview for pendulum-pay ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@pendulum-chain/devs Ready for review ✅ |
Remove T&C dialog
setEvents((prevEvents) => [...prevEvents, { value: message, status }]); | ||
}; | ||
|
||
const trackOfframpingEvent = useCallback( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we could move this to useEventsContext
? Especially since we remove the addEvent
thingy. This useOfframpEvents
is a bit intermediary.
If it's too much trouble then no need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gianfra-t I think we should keep the logic in a custom hook and in the Events Context keep only state-related code. The Event Context file is actually quite big right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the new library and refactor 💪. I think we still could get rid of so many hook states especially those regarding sep24 which are all over the place, like setAnchorSessionParams
which for example has useSEP24Cleanup
in a separate hook. But that for later otherwise the PR will grow a lot.
add fromAmount and showFees url params
@gianfra-t Do we merge it to staging? |
I haven't tested lately on this PR, but if it is working, let's go! |
@gianfra-t Could you approve 🙏 🟢 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I did before!
PR 🦈 🟢
Overview
Introduce Zustand for feature-state management.
State management in the app:
Global State =
React Context + Zustand
Feature State =
Zustand
Server State =
Tanstack/react-query
Purpose
Currently, the app suffers from disorganized, logic and state management are entangled in a single large file, along with event listeners for multiple features. This makes introducing changes or even testing the code extremely challenging.
Changes
Introduce
offrampStore
for offramp feature related state (types are defined within/types/offramp.ts
)Introduce
useOfframpAdvancement
custom hook for advancement of offramp phaseIntroduce
useOfframpEvents
custom hook for offramp events related logicRefactor
useMainProcess
custom hook