forked from cowprotocol/cowswap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(limit): recreate order (cowprotocol#3845)
* chore: add crude recreate modal * refactor: move state to common/state * refactor: rename recreateOrder to alternativeOrder * feat: use alternative limit order atoms when flag is set * refactor: shorten local atom names * refactor: add readWriteAtomFactory syntactic sugar * refactor: simplify atom types * chore: add option to set isUnlocked on default state * chore: accept partial state * refactor: use exposed hooks rather than atom directly * refactor: rename useGetAlternativeOrder to useAlternativeOrder * fix: use SELL order as default limit, no idea why I changed to BUY * chore: do not overwrite input/out currency ids if not present * feat: show recipient field when recipient is set in state * feat: do not reset recipient on load when it's alternative modal * feat: do not show app switcher when in alternative modal * feat: do not setup trade state when alternative modal * feat: load currency amount from atoms too * feat: disable selectors and switched on alternative modal * refactor: move factory utils to alternativeOrder state * feat: use alternative state for partiallyFillableOverrideAtom * chore: add placeholder to keep settings button on the right side * feat: duplicate limitOrderSettings atoms * chore: remove RecreateOrderModal components * feat: add AlternativeLimitOrder page * feat: display regular or alternative limit order pages according to flag * refactor: clean up LimitOrders page * refactor: simplify alternativeOrder state * feat: set partialFillEnabled feature flag on if the order was partiallyFillable * feat: move back to limit orders page after order is recreated * fix: remove duplicated css prop z-index * feat: use repeat icon for recreate limit order action * refactor: use Command instead of () => void * chore: remove TODO * fix: add missing import * feat: do not show recreate button for pending orders * feat: hide alternative modal when account or chainId change * fix: fix build issues * refactor: split alternativeOrder index into multiple files * feat: do not update active rate when recreating the order * refactor: split AlternativeLimitOrderUpdater into separated hooks * refactor: group limit order updaters with order types * fix: recreate is only available for limit orders * feat(limit): move to open orders after limit placed (cowprotocol#3889) * refactor: organize imports and files on ordersTable module * feat: add helper hook useNavitageToOpenOrdersTable * feat: navitate to open orders table when limit order is placed * refactor: import from modules/tokens * test: fix unit tests * feat(limit): add recreate button to limit order receipt (cowprotocol#3890) * feat(limit): recreate v2 fix price (cowprotocol#3899) * feat: do not use InitialPriceUpdated on alternative limit orders * fix: reset state when loading to avoid stale data * refactor: recreate v2 refactor (cowprotocol#3900) * refactor: move alternativeOrder state from common into trade state * chore: do not export alternativeOrderAtomGetterFactory * fix: add missing hook dependency * feat(limit): fix price impact on load (cowprotocol#3929) * fix: clear existing market rate when alternative limit order form is loaded * fix: use pure JS numbers math to avoid issue with Fraction division * feat: recreate order styling (cowprotocol#3930) * feat: progress * feat: progress * feat: progress * feat: progress * feat: progress * feat: cleanup --------- Co-authored-by: fairlight <[email protected]>
- Loading branch information
1 parent
146c589
commit dd31431
Showing
64 changed files
with
846 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.