From 3dc94223aee9ec794562a6b5b368f93ee0091669 Mon Sep 17 00:00:00 2001 From: Aid19801 Date: Fri, 12 Nov 2021 18:22:03 +0000 Subject: [PATCH] Bug mapp nodemap (#897) * desktop onMouseEnter and leave handlers added * clicking nav option closes drawer * All AC met * removed dead bool * added hamburger to AppBar for mobile users small refactor * nuts and bolts working needs a lot of tidying though * Functionally complete. * change hardcode colors to theming * UI theme and border changes * bug fix removed collapse nav flicker * dead code * resetting drawer to closed onload * removal of hardcoded color * made null functions into optional props * Nested sx styling not global * paperprops now working * fixed breaking changes for DataGrid * linting fix * linting fix * optional chaining for nodemap search * leaner filter func Co-authored-by: Aid Thompson --- explorer/src/pages/MixnodesMap/index.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/explorer/src/pages/MixnodesMap/index.tsx b/explorer/src/pages/MixnodesMap/index.tsx index 20fddb36c6..3b9468965f 100644 --- a/explorer/src/pages/MixnodesMap/index.tsx +++ b/explorer/src/pages/MixnodesMap/index.tsx @@ -84,15 +84,11 @@ export const PageMixnodesMap: React.FC = () => { ); } else if (countryData?.data !== undefined && searchTerm !== '') { const formatted = countryDataToGridRow(Object.values(countryData?.data)); - const filtered = formatted.filter((m) => { - if ( - m.countryName.toLowerCase().includes(searchTerm) || - m.ISO3.toLowerCase().includes(searchTerm) - ) { - return m; - } - return null; - }); + const filtered = formatted.filter( + (m) => + m?.countryName?.toLowerCase().includes(searchTerm) || + m?.ISO3?.toLowerCase().includes(searchTerm), + ); if (filtered) { setFormattedCountries(filtered); }