-
Notifications
You must be signed in to change notification settings - Fork 19
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
[ECO-2161] Update market page with new grace period dynamics #237
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/typescript/frontend/src/lib/hooks/queries/use-grace-period.ts
Outdated
Show resolved
Hide resolved
src/typescript/frontend/src/lib/hooks/queries/use-grace-period.ts
Outdated
Show resolved
Hide resolved
src/typescript/frontend/src/lib/hooks/queries/use-grace-period.ts
Outdated
Show resolved
Hide resolved
…stable reference to `props.data.symbol` and `queryClient` Move grace period message to the top of the file Put the `canTrade` logic into a `useMemo` Add `numSwaps` to the `SwapButton` props so it re-renders properly when the # of swaps changes ready Clean up and consolidate hook logic, decouple the fetch logic from display interval logic Disable `useQuery` hook from fetching once the market is not in grace period
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.
Awesome, I sort of re-arranged a few things, but mostly kept the logic the same.
The main difference is I put the refetching logic into useQuery
in the enabled
field and then stop fetching when the market is out of the grace period.
I also changed the format to be 00:00
for the time left, since it was too big when looking at it on mobile. That was it though :D
Description
This PR integrates the new grace period dynamics:
In order to prevent the market registrant to trade on his own market, in case
of query failure, the UI will let anyone try to trade.
On trade, the grace period is automatically updated !
Screenshots
Testing
Go to vercel, register a market, go on the market page with two different accounts (registrant and another one).
Checklist