Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
(Market): fix laggy nav issue + double breadcrumb
Browse files Browse the repository at this point in the history
  • Loading branch information
LFBarreto committed May 18, 2022
1 parent 1d050e2 commit 3116662
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/Breadcrumb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Breadcrumb = () => (

<Route path="/asset/:assetId+" component={AssetCrumb} />
<Route path="/account/:id/nft-collection/:collectionAddress?" component={NFTCrumb} />
<Route path="/market" component={MarketCrumb} />

<Route path="/market/:currencyId/" component={MarketCrumb} />
</Wrapper>
);
Expand Down
10 changes: 2 additions & 8 deletions src/renderer/screens/market/MarketCoinScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,9 @@ export default function MarketCoinScreen() {
}, [rampCatalog.value]);

const availableOnBuy =
currency && currency.ticker && onRampAvailableTickers.includes(currency.ticker.toUpperCase());
currency && currency.ticker && onRampAvailableTickers.includes(currency.ticker?.toUpperCase());
const availableOnSwap = internalCurrency && swapAvailableIds.includes(internalCurrency.id);

useEffect(() => {
return () => {
selectCurrency();
};
}, [selectCurrency]);

const color = internalCurrency
? getCurrencyColor(internalCurrency, colors.background.main)
: colors.primary.c80;
Expand All @@ -144,7 +138,7 @@ export default function MarketCoinScreen() {
},
});
},
[internalCurrency, history, currency],
[history, currency],
);

const openAddAccounts = useCallback(() => {
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/screens/market/MarketList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const CurrencyRow = memo(function CurrencyRowItem({
locale,
swapAvailableIds,
onRampAvailableTickers,
range,
style,
}: any) {
const currency = data ? data[index] : null;
Expand All @@ -230,6 +231,7 @@ const CurrencyRow = memo(function CurrencyRowItem({
selectCurrency={selectCurrency}
availableOnBuy={availableOnBuy}
availableOnSwap={availableOnSwap}
range={range}
style={{ ...style }}
/>
);
Expand Down Expand Up @@ -276,7 +278,7 @@ function MarketList({
} = useMarketData();
const dispatch = useDispatch();

const { orderBy, order, starred, search } = requestParams;
const { orderBy, order, starred, search, range } = requestParams;
const currenciesLength = marketData.length;
const freshLoading = loading && !currenciesLength;

Expand Down Expand Up @@ -368,6 +370,7 @@ function MarketList({
locale={locale}
swapAvailableIds={swapAvailableIds}
onRampAvailableTickers={onRampAvailableTickers}
range={range}
/>
)}
</List>
Expand Down Expand Up @@ -400,6 +403,7 @@ function MarketList({
locale={locale}
swapAvailableIds={swapAvailableIds}
onRampAvailableTickers={onRampAvailableTickers}
range={range}
/>
)}
</List>
Expand Down

1 comment on commit 3116662

@github-actions
Copy link

Choose a reason for hiding this comment

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

Lint outputs ✅

Tests outputs ✅

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
PASS src/generate-cryptoassets-md.test.js
PASS src/renderer/actions/swap.test.js (13.703 s)

Test Suites: 1 skipped, 2 passed, 2 of 3 total
Tests: 5 skipped, 2 passed, 7 total
Snapshots: 0 total
Time: 16.099 s
Test results written to: report.json

Diff output ❌

linux

Actual Diff Expected

| market-btc-page-actual | market-btc-page-diff | market-btc-page-expected |
| market-btc-page-actual | market-btc-page-diff | market-btc-page-expected |

windows

Actual Diff Expected

| market-btc-page-actual | market-btc-page-diff | market-btc-page-expected |
| market-btc-page-actual | market-btc-page-diff | market-btc-page-expected |

Please sign in to comment.