Skip to content

Commit

Permalink
Merge pull request #761 from bancorprotocol/externalTokens
Browse files Browse the repository at this point in the history
#757 - Remove external trade option from the trade widget
  • Loading branch information
pingustar authored Nov 22, 2023
2 parents 70bddbf + d2ac5e3 commit 73bd974
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/elements/swapWidget/SwapWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Insight } from 'elements/swapInsights/Insight';
import { IntoTheBlock, intoTheBlockByToken } from 'services/api/intoTheBlock';
import { useAsyncEffect } from 'use-async-effect';
import { TradeWidget } from 'elements/trade/TradeWidget';
import { getTradeTokensWithExternal } from 'store/bancor/bancor';
import { getV2AndV3Tokens } from 'store/bancor/bancor';

interface SwapWidgetProps {
from: string | null;
Expand All @@ -16,7 +16,7 @@ interface SwapWidgetProps {
}

export const SwapWidget = ({ from, to, limit }: SwapWidgetProps) => {
const tokens = useAppSelector<TokenMinimal[]>(getTradeTokensWithExternal);
const tokens = useAppSelector<TokenMinimal[]>(getV2AndV3Tokens);

const ethOrFirst = useCallback(() => {
const eth = tokens.find((x) => x.address === ethToken);
Expand Down
13 changes: 0 additions & 13 deletions src/store/bancor/bancor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,6 @@ export const getV2AndV3Tokens = createSelector(
}
);

export const getTradeTokensWithExternal = createSelector(
(state: RootState) => state.bancor.tokensV2,
(state: RootState) => state.bancor.tokensV3,
(state: RootState) => state.bancor.tokensForTradeWithExternal,
(tokensV2, tokensV3, tokensForTradeWithExternal): TokenMinimal[] => {
const tlTokens: TokenMinimal[] = tokensForTradeWithExternal.map((t) => ({
...t,
isExternal: true,
}));
return uniqBy([...tokensV3, ...tokensV2, ...tlTokens], (x) => x.address);
}
);

export const bancor = bancorSlice.reducer;

export const getIsAppBusy = createSelector(
Expand Down

0 comments on commit 73bd974

Please sign in to comment.