This repository has been archived by the owner on Jan 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Conversation
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
Update src/hooks/useNetworkCheck.tsx Co-authored-by: Velenir <Velenir@users.noreply.github.com>
Velenir
approved these changes
Oct 23, 2020
anxolin
reviewed
Oct 26, 2020
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.
Cool! I like it!
Only comment, can you try setting closeButton: false
and closeOnClick: false
I think is good! 👌 |
anxolin
approved these changes
Oct 27, 2020
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.
Works great
Velenir
added a commit
that referenced
this pull request
Nov 3, 2020
* Refactoring: moving OrdeBookWidget component to its own folder * Refactoring: splitting component into smaller files * Refactoring: commenting useEffectHooks and ordering them * Refactoring: renamed component from OrderBookWidget to OrderBookChart * Adjusting y axis on one sided markets * Leaving it up to amCharts to decide how to space the grids * 1295/linear orderbook styling (#1299) * remove dead CSS * consistency changes 1. text: BT/QT (/) 2. Volume (BT) Y-axis 3. Price(BT/QT) X-axis * styling * make upper scrollbar opacity lower * adapt chartFuntions * adapt dataProcessing * adapt zoomFunctions * adapt OrderBookChart * adapt OrderBookWidget * move stories to components * rename folder * fix name * lint fixes * xDAI price estimate prod URL * 1336/tooltip date orders (#1507) * add dates to OrdersWidget in Trade * expireDateLocal > expireDateFormatted * 1.5.1 * updated README to add compatible networks and URLs to wiki (#1537) * move toast to custom wrapped container (#1539) 1. encapsulates custom styles and moves out of global * Modal (prev. modali) Storybook stories (#1508) * export ModalOptions and ModalProps * Modal stories * use action and make modal smaller * rename css variable to generic + variable defaults * wrapped datetimepicker in global styles (#1542) 1. removed redundant global.ts styles * [Smart Quote] COMPLETE (#1492) * Add token priorities * Add priority and new market types * Add market util * Add test for getMarket util * Improve tests * Add change in implementation (forgot to commit) * Load priority for tokens * User automatic market selection * Add token priorities and smart quote selection util (#1474) * Add token priorities * Add priority and new market types * Add market util * Add test for getMarket util * Improve tests * Add change in implementation (forgot to commit) * Smart quote load priority (#1478) * Add token priorities * Add priority and new market types * Add market util * Add test for getMarket util * Improve tests * Add change in implementation (forgot to commit) * Load priority for tokens * Memoize and add debug * Calculate the received tokens using the right price * Fix typo * Use cannonical market in tx confirmation * Simplify prices in order row * Refactor price calculation into smartPrice component * Add title to smart price * Remove title from swap token * [Smart Quote] User automatic market selection (#1479) * Add token priorities * Add priority and new market types * Add market util * Add test for getMarket util * Improve tests * Add change in implementation (forgot to commit) * Load priority for tokens * User automatic market selection * Memoize and add debug * Calculate the received tokens using the right price * Fix typo * Use cannonical market in tx confirmation * Create new price fraction and memoize * Smart quote market selection widget (#1531) * Add token priorities * Add priority and new market types * Add market util * Add test for getMarket util * Improve tests * Add change in implementation (forgot to commit) * Load priority for tokens * User automatic market selection * Memoize and add debug * Calculate the received tokens using the right price * Fix typo * Use cannonical market in tx confirmation * Fix var name * Use setter function for hook * Show buy sell fills (#1530) * Show side and price units * Allow to invert price * Memoize info * Do not use anchor for market * Remove unused var * [Smart Quote]: Add useBestAsk hook to PriceSuggestionsWidget (#1533) * useBestAsk hook * PriceSuggestions: add useBestAsk hook * [Smart Quote] TradesRow data rearrangement - swap Limit/Fill price and Sell/Bought column split (#1535) * TradesWidget: move rows around 1. Date is moved right of Order ID 2. Sold/Bought split into 2 columns * change labels and fix filter * remove Pair title & css changes * Trades split limit fill price (#1536) * add/calc surplus to TradeRow * make data fit * surplus bold/green/text change * fix style issue as table sizes grow 1. orders widget is larger to fit more data * OrdersWidget: rearrange data presentation (#1541) 1. split total/filled * remove wasPriorityAdjusted Co-authored-by: David <david.sato64@gmail.com> * Network check 2 (#1546) * deal with incorrect network * PR changes, thank you to the legend @Velenir * rel noopener Update src/hooks/useNetworkCheck.tsx Co-authored-by: Velenir <Velenir@users.noreply.github.com> * block toast click close or button Co-authored-by: Velenir <Velenir@users.noreply.github.com> * travis yml: sticky node v12 (#1556) * wxDAI priority list (#1555) * [Smart Quote] Fix broken **limitPrice** amount (#1554) * PriceSuggestion: check adjusted market and use correct price 1. pass original token pair to price estimation logic 2. invert price when adjusted market detected * tradewidget - pricesuggestion 1. pass original tokens as props 2. comment on props for ease * add autoWidth prop to self adjust (#1560) * Update orderbookSamples.ts (#1439) * Update orderbookSamples.ts Added some new examples, deleted old examples that didn't break the orderbook in the past. * travis yml: sticky node v12 Co-authored-by: Velenir <Velenir@users.noreply.github.com> Co-authored-by: David Sato <david.sato64@gmail.com> * 1545 - Show percentage filled & fix incorrect market order in orders (#1562) * calculate filled amount percentage 1. change surplus min to 0.01% * show proper market in orderrow * logic cleanup for TS * memo getMarket * fix filled percentage css * connect wallet width auto * [Price Impact]: Base (#1509) * remove amount shown in Fill Price * create PriceImpact component * PriceSuggestionsWidget/Child 1. remove Best Ask comp + calc 2. export Wrapper 3. remove dead props * add priceimpact to tradewidget * THRESHOLD constant values * const: doesnt need threshold vals 1. move to priceimpact * memoise colourClass and use BigNumber thresholds * fix stories/build * format price impact * fixed tooltip style * edited calculation, changed smart format limit, dont show on ZERO * change of red colour * [Price Impact] Warnings in PriceSuggestions (#1544) * small util for checking truthiness * move PriceImpact into PriceSuggestionsWidget * move unrelated files into more related FS * rename isTruthy util fn and use in PriceSUggestions * styling 1.added button-warning red 2. label no background 3. added midImpact class * utils: decouple some of the impact level determining logic 1. add midPrice and high price impact thres 2. warning logic fix * saving warning label change * address PR comments 1. use standard FormMessage 2. dont show warning on using suggested price 3. change tooltip text * put in useBestAsk hook * added placeholder slippage of 0.5% 1. protects against Deep Market warning showing too frequently 2. added some comments for clarity * addressed PR comments: 1. remove TODO useBestAsk comment 2. simplify priceImpactSmart logic thanks @anxolin 3. use switch cases 4. fix formatSmart broken small amount 5. use enum in priceimpact/utils 6. isStrNumTruthy > isNonZeroNumber rename * [Price Impact] Confirmation Modal Warnings (#1550) * add priceimpact to tradewidget * [Price Impact] Warnings in PriceSuggestions (#1544) * small util for checking truthiness * move PriceImpact into PriceSuggestionsWidget * move unrelated files into more related FS * rename isTruthy util fn and use in PriceSUggestions * styling 1.added button-warning red 2. label no background 3. added midImpact class * utils: decouple some of the impact level determining logic 1. add midPrice and high price impact thres 2. warning logic fix * saving warning label change * address PR comments 1. use standard FormMessage 2. dont show warning on using suggested price 3. change tooltip text * put in useBestAsk hook * added placeholder slippage of 0.5% 1. protects against Deep Market warning showing too frequently 2. added some comments for clarity * addressed PR comments: 1. remove TODO useBestAsk comment 2. simplify priceImpactSmart logic thanks @anxolin 3. use switch cases 4. fix formatSmart broken small amount 5. use enum in priceimpact/utils 6. isStrNumTruthy > isNonZeroNumber rename * move unrelated files into more related FS * saving warning label change * moved logic to usePriceImpact hook * move types to type subfolder * add usePRiceImpact hook * added price impact warnings to TxMessage * errors as constants * changed warning message type to object * removed error title * usePriceImpact compact logic * utils: 1. made warnings into constants 2. reworked some of the warning label logic * PriceImpact %: show 0 when 0 or negative * remove logDebug * add PriceImpact into conf modal * small change 1. extrapolate SimplePriceImpact to reuse 2. new type 3. warnings all have icon * use fontawesome over system font * enum doesnt need assigned numbers * exhaustive cases for switch/case no default * [Price Impact] Fix broken warnings on adjusted market (#1557) * commented/cleaned up utils * Impact: use absolute pair & quote price * fix warning in confirmation modal * flip base for quote in low vol calc (#1559) * Tx approval timeout (#1547) Tx approval timeout * Fix TS issue Co-authored-by: Leandro Boscariol <leandro.boscariol@gnosis.io> Co-authored-by: David <david.sato64@gmail.com> Co-authored-by: Anxo Rodriguez <anxolin@gmail.com> Co-authored-by: Rafanator <rafael.suarez333@gmail.com>
Merged
anxolin
added a commit
that referenced
this pull request
Jan 11, 2021
* Refactoring: moving OrdeBookWidget component to its own folder * Refactoring: splitting component into smaller files * Refactoring: commenting useEffectHooks and ordering them * Refactoring: renamed component from OrderBookWidget to OrderBookChart * Adjusting y axis on one sided markets * Leaving it up to amCharts to decide how to space the grids * 1295/linear orderbook styling (#1299) * remove dead CSS * consistency changes 1. text: BT/QT (/) 2. Volume (BT) Y-axis 3. Price(BT/QT) X-axis * styling * make upper scrollbar opacity lower * adapt chartFuntions * adapt dataProcessing * adapt zoomFunctions * adapt OrderBookChart * adapt OrderBookWidget * move stories to components * rename folder * fix name * lint fixes * xDAI price estimate prod URL * 1336/tooltip date orders (#1507) * add dates to OrdersWidget in Trade * expireDateLocal > expireDateFormatted * 1.5.1 * updated README to add compatible networks and URLs to wiki (#1537) * move toast to custom wrapped container (#1539) 1. encapsulates custom styles and moves out of global * Modal (prev. modali) Storybook stories (#1508) * export ModalOptions and ModalProps * Modal stories * use action and make modal smaller * rename css variable to generic + variable defaults * wrapped datetimepicker in global styles (#1542) 1. removed redundant global.ts styles * [Smart Quote] COMPLETE (#1492) * Add token priorities * Add priority and new market types * Add market util * Add test for getMarket util * Improve tests * Add change in implementation (forgot to commit) * Load priority for tokens * User automatic market selection * Add token priorities and smart quote selection util (#1474) * Add token priorities * Add priority and new market types * Add market util * Add test for getMarket util * Improve tests * Add change in implementation (forgot to commit) * Smart quote load priority (#1478) * Add token priorities * Add priority and new market types * Add market util * Add test for getMarket util * Improve tests * Add change in implementation (forgot to commit) * Load priority for tokens * Memoize and add debug * Calculate the received tokens using the right price * Fix typo * Use cannonical market in tx confirmation * Simplify prices in order row * Refactor price calculation into smartPrice component * Add title to smart price * Remove title from swap token * [Smart Quote] User automatic market selection (#1479) * Add token priorities * Add priority and new market types * Add market util * Add test for getMarket util * Improve tests * Add change in implementation (forgot to commit) * Load priority for tokens * User automatic market selection * Memoize and add debug * Calculate the received tokens using the right price * Fix typo * Use cannonical market in tx confirmation * Create new price fraction and memoize * Smart quote market selection widget (#1531) * Add token priorities * Add priority and new market types * Add market util * Add test for getMarket util * Improve tests * Add change in implementation (forgot to commit) * Load priority for tokens * User automatic market selection * Memoize and add debug * Calculate the received tokens using the right price * Fix typo * Use cannonical market in tx confirmation * Fix var name * Use setter function for hook * Show buy sell fills (#1530) * Show side and price units * Allow to invert price * Memoize info * Do not use anchor for market * Remove unused var * [Smart Quote]: Add useBestAsk hook to PriceSuggestionsWidget (#1533) * useBestAsk hook * PriceSuggestions: add useBestAsk hook * [Smart Quote] TradesRow data rearrangement - swap Limit/Fill price and Sell/Bought column split (#1535) * TradesWidget: move rows around 1. Date is moved right of Order ID 2. Sold/Bought split into 2 columns * change labels and fix filter * remove Pair title & css changes * Trades split limit fill price (#1536) * add/calc surplus to TradeRow * make data fit * surplus bold/green/text change * fix style issue as table sizes grow 1. orders widget is larger to fit more data * OrdersWidget: rearrange data presentation (#1541) 1. split total/filled * remove wasPriorityAdjusted Co-authored-by: David <david.sato64@gmail.com> * Network check 2 (#1546) * deal with incorrect network * PR changes, thank you to the legend @Velenir * rel noopener Update src/hooks/useNetworkCheck.tsx Co-authored-by: Velenir <Velenir@users.noreply.github.com> * block toast click close or button Co-authored-by: Velenir <Velenir@users.noreply.github.com> * travis yml: sticky node v12 (#1556) * wxDAI priority list (#1555) * [Smart Quote] Fix broken **limitPrice** amount (#1554) * PriceSuggestion: check adjusted market and use correct price 1. pass original token pair to price estimation logic 2. invert price when adjusted market detected * tradewidget - pricesuggestion 1. pass original tokens as props 2. comment on props for ease * add autoWidth prop to self adjust (#1560) * Update orderbookSamples.ts (#1439) * Update orderbookSamples.ts Added some new examples, deleted old examples that didn't break the orderbook in the past. * travis yml: sticky node v12 Co-authored-by: Velenir <Velenir@users.noreply.github.com> Co-authored-by: David Sato <david.sato64@gmail.com> * 1545 - Show percentage filled & fix incorrect market order in orders (#1562) * calculate filled amount percentage 1. change surplus min to 0.01% * show proper market in orderrow * logic cleanup for TS * memo getMarket * fix filled percentage css * connect wallet width auto * [Price Impact]: Base (#1509) * remove amount shown in Fill Price * create PriceImpact component * PriceSuggestionsWidget/Child 1. remove Best Ask comp + calc 2. export Wrapper 3. remove dead props * add priceimpact to tradewidget * THRESHOLD constant values * const: doesnt need threshold vals 1. move to priceimpact * memoise colourClass and use BigNumber thresholds * fix stories/build * format price impact * fixed tooltip style * edited calculation, changed smart format limit, dont show on ZERO * change of red colour * [Price Impact] Warnings in PriceSuggestions (#1544) * small util for checking truthiness * move PriceImpact into PriceSuggestionsWidget * move unrelated files into more related FS * rename isTruthy util fn and use in PriceSUggestions * styling 1.added button-warning red 2. label no background 3. added midImpact class * utils: decouple some of the impact level determining logic 1. add midPrice and high price impact thres 2. warning logic fix * saving warning label change * address PR comments 1. use standard FormMessage 2. dont show warning on using suggested price 3. change tooltip text * put in useBestAsk hook * added placeholder slippage of 0.5% 1. protects against Deep Market warning showing too frequently 2. added some comments for clarity * addressed PR comments: 1. remove TODO useBestAsk comment 2. simplify priceImpactSmart logic thanks @anxolin 3. use switch cases 4. fix formatSmart broken small amount 5. use enum in priceimpact/utils 6. isStrNumTruthy > isNonZeroNumber rename * [Price Impact] Confirmation Modal Warnings (#1550) * add priceimpact to tradewidget * [Price Impact] Warnings in PriceSuggestions (#1544) * small util for checking truthiness * move PriceImpact into PriceSuggestionsWidget * move unrelated files into more related FS * rename isTruthy util fn and use in PriceSUggestions * styling 1.added button-warning red 2. label no background 3. added midImpact class * utils: decouple some of the impact level determining logic 1. add midPrice and high price impact thres 2. warning logic fix * saving warning label change * address PR comments 1. use standard FormMessage 2. dont show warning on using suggested price 3. change tooltip text * put in useBestAsk hook * added placeholder slippage of 0.5% 1. protects against Deep Market warning showing too frequently 2. added some comments for clarity * addressed PR comments: 1. remove TODO useBestAsk comment 2. simplify priceImpactSmart logic thanks @anxolin 3. use switch cases 4. fix formatSmart broken small amount 5. use enum in priceimpact/utils 6. isStrNumTruthy > isNonZeroNumber rename * move unrelated files into more related FS * saving warning label change * moved logic to usePriceImpact hook * move types to type subfolder * add usePRiceImpact hook * added price impact warnings to TxMessage * errors as constants * changed warning message type to object * removed error title * usePriceImpact compact logic * utils: 1. made warnings into constants 2. reworked some of the warning label logic * PriceImpact %: show 0 when 0 or negative * remove logDebug * add PriceImpact into conf modal * small change 1. extrapolate SimplePriceImpact to reuse 2. new type 3. warnings all have icon * use fontawesome over system font * enum doesnt need assigned numbers * exhaustive cases for switch/case no default * [Price Impact] Fix broken warnings on adjusted market (#1557) * commented/cleaned up utils * Impact: use absolute pair & quote price * fix warning in confirmation modal * flip base for quote in low vol calc (#1559) * Tx approval timeout (#1547) Tx approval timeout * Fix TS issue Co-authored-by: Leandro Boscariol <leandro.boscariol@gnosis.io> Co-authored-by: David <david.sato64@gmail.com> Co-authored-by: Anxo Rodriguez <anxolin@gmail.com> Co-authored-by: Rafanator <rafael.suarez333@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1543 was broken somehow in backend so retrying here...
Closes #283
Deals with incorrect network using CONFIG list's default accepted networks and uses toast.error pointing users to a our repo's wiki about networks.
THE URL IN THE TOAST ERROR NEEDS TO POINT ELSEWHERE!! Right now it is pointing to THIS repo.
Thoughts on toast approach?