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

Add liquidity sources setting/panel in Settings #1130

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

hungdoansy
Copy link
Contributor

@hungdoansy hungdoansy commented Jul 15, 2022

Description

Implement a panel displaying liquidity sources (DEXes) that KyberSwap has integrated with, for each chain. This will be placed in Settings panel.

@kyber-ci-bot
Copy link

Auto Deploy Pull Request

Your domain dmm-interface-1130.pr.kyberengineering.io has been created.

Notes

  • Please wait up to 60s, we need to pull your image.
  • This domain only validity until this PR is closed

@hungdoansy hungdoansy force-pushed the feature/display-integrated-dexes branch 2 times, most recently from 6c98641 to 713dd13 Compare July 15, 2022 07:25
@hungdoansy hungdoansy marked this pull request as ready for review July 15, 2022 07:31
>
}

const chainIdMapping: Partial<Record<ChainId, string>> = {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use NETWORKS_INFO variable
NETWORKS_INFO[chainId].route

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. They are all the same, except for BSC. I need bsc instead of bnb (as in its route), so I decided to manually do mapping like this.

Copy link
Contributor

Choose a reason for hiding this comment

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

can we deal with backend update bsc to bnb =)) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok let me ask

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BE refused this change request

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok this seems better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank @nguyenhoaidanh. as long as it's not changed frequently, it's OK

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it never changes :D

Copy link
Contributor

Choose a reason for hiding this comment

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

It's more than reusable. If you have a deep search on NETWORK_INFOS, there are fields only use once but still lie there.

So why would we put it there? It's the answers for the situation that everytime we think about a piece of data that different accross networks, we first think it must stay in NETWORK_INFOS.

Also, might you didn't care about maintainability, when we add a new chain, everything lie in one place is much more easily to find than many piece of data lie everywhere in the repository.

So in your case, what if we gonna add new chain like Celo for example. I fill up every infomation in constants/networks/celo.ts, but I missed this object, and this object dont shown up with error. So no one gonna known that I have missed this obj.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Valid point. It's bad 👍

@hungdoansy hungdoansy force-pushed the feature/display-integrated-dexes branch 3 times, most recently from 954c09b to 1611fbe Compare July 15, 2022 09:21
@nguyenhoaidanh
Copy link
Contributor

LGTM

Comment on lines 40 to 42
if (error || !data) {
console.error(error)
return null
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This gonna flooding console.error if this component keep re-rendering. This will gonna likely to be happened because our codebase is not optimize well in times of re-rendering.

Please remove console.error, left only return null. If you still want to log it, move it into useEffect

Also, please add some meaningful message too. Dont log only error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I removed it.

@hungdoansy hungdoansy force-pushed the feature/display-integrated-dexes branch from 1611fbe to 3ded6cf Compare July 17, 2022 01:55
@viet-nv viet-nv merged commit 01668bd into feature/modern-theme Jul 18, 2022
@viet-nv viet-nv deleted the feature/display-integrated-dexes branch July 18, 2022 03:29
@kyber-ci-bot
Copy link

Auto Deploy Pull Request

Your domain dmm-interface-1130.pr.kyberengineering.io has been revoked because: PR closed.

Notes

  • Please re-open the PR to re-create this domain!

viet-nv added a commit that referenced this pull request Jul 25, 2022
* init

* style: change background color

* style: swwap page

* style: swap form

* move recipient to address input

* finish swap page

* fix: detail box animation

* style: pools page

* style: redesign pools page

* update action button icon

* pools page

* mypools page

* mypools page

* classic pools page

* style: about page

* style: trending soon

* style: truesight

* add/remove liquidity elastic

* addliquidity classic

* add/remove liquidity

* leader board

* fiX: increase liquidity rinkeby

* feat(add liquidity elastic): change select fee style

* style: update max/half btn

* feat: fee tier distribution

* feat:  add instruction text for pools

* farm guide

* Swap Transaction settings (#1123)

* wip

* wip: rename legacy toggle and the new toggle

* wip: transaction time limit setting

* wip: refactor toggle to use in darker background

* wip: slippage setting

* wip: transaction time limit setting

* wip: swap settings panel

* wip: advanced mode setting

* wip: swap settings panel

* wip: swap settings panel

* wip: advanced mode setting and modal

* wip(toggle): move Dot out of Toggle

* style: elastic farm

* style: classic farm

* fix: mix panel crash

* style: fix farm page css

* fix: switch token on swap page

* feat(swap-settings): add liquidity sources setting/panel (#1130)

* feat(swap-settings): implement GasPriceTracker panel (#1129)

Co-authored-by: viet-nv <vietnv1304@gmail.com>

* style: fix select a token text on add liquidity when screen is too small

* fix: receipient issue when turn off expert mode

* style: my pool layout

* fix: liquidity source

* popups

* fix(gas-price-tracker): correct DeBank slug for optimism

* fix: cant switch/select token when we have in/output currency on url

* style(token-modal): update ui

* show common bases on pools select token

* refactor(network-modal): duplicate component on wrong network modal

* Highlight buttons when redirecting from About page (#1142)

* feat(pool): highlight Add Liquidity button when redirecting from About

* chore(about): update text color of View Farms button

* fix: recipient still there when turn off advance mode

* style(pro-chart): update background color

* feat(pools): add stable pools filter

* style(farm)

* fix: reset page to 1 when select stable pools

* style(classic-vesting): vesting summary

* style: classic vesting

* refactor(slippage-setting): split components

* fix: layout issue

* feat(liquidity-sources-panel): show scroll bar

* feat(swap): highlight Swap box when redirecting from About page

* add claim popup

* change bnb elastic subgraph to prod account

* update live chart mobile

* update knc about text

* update tutorial linkl

* style: farm page

* syle: tweak some ui

* fix: kami comment

* fix: prakhar comment

* style(about): use ButtonLight for View Farms

* fix: balace

* update tutorial popup

* fixed comment

* chore: highlight buttons when URL params match the condition

* chore(aggregator-stats): add header to get the latest version of API

* style(advance-mode-popup): refactor to reuse advance mode popup

* change container size of campaign and truesight

* add tooltip on swap setting

* fix: swap form is not central

* only show 5 tx in account detail popup

* fix: header dropdown

Co-authored-by: Hung Doan <19758667+hungdoansy@users.noreply.github.com>
Co-authored-by: Doan Sy Hung <hungdoansy@gmail.com>
nguyenhoaidanh added a commit that referenced this pull request Aug 5, 2022
* init

* style: change background color

* style: swwap page

* style: swap form

* move recipient to address input

* finish swap page

* fix: detail box animation

* style: pools page

* style: redesign pools page

* update action button icon

* pools page

* mypools page

* mypools page

* classic pools page

* style: about page

* style: trending soon

* style: truesight

* add/remove liquidity elastic

* addliquidity classic

* add/remove liquidity

* leader board

* fiX: increase liquidity rinkeby

* feat(add liquidity elastic): change select fee style

* style: update max/half btn

* feat: fee tier distribution

* feat:  add instruction text for pools

* farm guide

* Swap Transaction settings (#1123)

* wip

* wip: rename legacy toggle and the new toggle

* wip: transaction time limit setting

* wip: refactor toggle to use in darker background

* wip: slippage setting

* wip: transaction time limit setting

* wip: swap settings panel

* wip: advanced mode setting

* wip: swap settings panel

* wip: swap settings panel

* wip: advanced mode setting and modal

* wip(toggle): move Dot out of Toggle

* style: elastic farm

* style: classic farm

* fix: mix panel crash

* style: fix farm page css

* fix: switch token on swap page

* feat(swap-settings): add liquidity sources setting/panel (#1130)

* feat(swap-settings): implement GasPriceTracker panel (#1129)

Co-authored-by: viet-nv <vietnv1304@gmail.com>

* style: fix select a token text on add liquidity when screen is too small

* fix: receipient issue when turn off expert mode

* style: my pool layout

* fix: liquidity source

* popups

* fix(gas-price-tracker): correct DeBank slug for optimism

* fix: cant switch/select token when we have in/output currency on url

* style(token-modal): update ui

* show common bases on pools select token

* refactor(network-modal): duplicate component on wrong network modal

* Highlight buttons when redirecting from About page (#1142)

* feat(pool): highlight Add Liquidity button when redirecting from About

* chore(about): update text color of View Farms button

* fix: recipient still there when turn off advance mode

* style(pro-chart): update background color

* feat(pools): add stable pools filter

* style(farm)

* fix: reset page to 1 when select stable pools

* style(classic-vesting): vesting summary

* type && swap 

tobe continue

* chore

* style: classic vesting

* split component

* refactor(slippage-setting): split components

* fix: layout issue

* feat(liquidity-sources-panel): show scroll bar

* feat(swap): highlight Swap box when redirecting from About page

* add claim popup

* token info Accordion


.

* change bnb elastic subgraph to prod account

* update live chart mobile

* update knc about text

* update tutorial linkl

* rm unuse package

* update tutorial linkl

* style: farm page

* syle: tweak some ui

* update ux

* fix some eslint

* fix: kami comment

* fix: prakhar comment

* style(about): use ButtonLight for View Farms

* fix: balace

* update tutorial popup

* update tutorial popup

* fixed comment

* chore: highlight buttons when URL params match the condition

* chore(aggregator-stats): add header to get the latest version of API

* style(advance-mode-popup): refactor to reuse advance mode popup

* change container size of campaign and truesight

* add tooltip on swap setting

* fix: swap form is not central

* only show 5 tx in account detail popup

* fix: header dropdown

* fix conflict

* connect api get

* build


add/remove pairt


fix find token


intergrade api

* use logo

* build


update ux

* update ux


update feedback prakhar


update uxx


fix: can not import


.


update ux


update ux

* fix conflict

* update ux

* sort pair

* fix: chain network not refetch

* fix ctrl+k window

* fix amount wrong


show favorite only login


refresh after add/remove pairs


search favorite pair


update ux


update color design


enter feature


update color mobile


.


fix: text overflow


split component


.


.

* remove conflict qs

* enter to import token modal

* icon enter button


icon enter button


fix wrong order 


rm unuse

* update api

* update feedback

* fix feedback

* update feedback

* add comment

* update feedback

* update feedback

* update text token info

* update feedback

* update feedback

* update feedback

* update feedback

* fix issues: chớp token warning

* fix css

* fix ios outline

* tracking, toast.


.


alert warning

* fix conflict

* add tracking

* update tooltip

* update font

* fix bug: not show toast after typing

* fix: popup close nearest

* fix notipopup

* fix bug change change

* fix blur

* refactor popup

* fix bug can not like pair

* update api

Co-authored-by: Nguyen Van Viet <vietnv1304@gmail.com>
Co-authored-by: Hung Doan <19758667+hungdoansy@users.noreply.github.com>
Co-authored-by: Doan Sy Hung <hungdoansy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants