From 7cc9788c854303eff5fb6a89f2bf37b601e815f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduard=20Bardaj=C3=AD=20Puig?= Date: Tue, 1 Oct 2024 12:56:33 +0100 Subject: [PATCH 1/2] Change nullish coalescing to ternary (#639) --- src/app/components/rareSatIcon/rareSatIcon.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/rareSatIcon/rareSatIcon.tsx b/src/app/components/rareSatIcon/rareSatIcon.tsx index 9a2a4e376..79130d074 100644 --- a/src/app/components/rareSatIcon/rareSatIcon.tsx +++ b/src/app/components/rareSatIcon/rareSatIcon.tsx @@ -35,8 +35,8 @@ import styled from 'styled-components'; const Image = styled.img<{ size?: number }>` object-fit: cover; - width: ${(props) => `${props.size}px` ?? '100%'}; - height: ${(props) => `${props.size}px` ?? '100%'}; + width: ${(props) => (typeof props.size === 'undefined' ? '100%' : `${props.size}px`)}; + height: ${(props) => (typeof props.size === 'undefined' ? '100%' : `${props.size}px`)}; `; interface Props { From 84cb04b08874293a1148799d31e96a16e4f54473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduard=20Bardaj=C3=AD=20Puig?= Date: Tue, 1 Oct 2024 17:52:28 +0100 Subject: [PATCH 2/2] Remove unreachable expressions (#641) --- src/app/screens/swap/useMasterCoinsList.tsx | 11 +++++------ src/app/screens/swap/useVisibleMasterCoinsList.tsx | 13 ++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/app/screens/swap/useMasterCoinsList.tsx b/src/app/screens/swap/useMasterCoinsList.tsx index 51cfd440e..2beb12cb8 100644 --- a/src/app/screens/swap/useMasterCoinsList.tsx +++ b/src/app/screens/swap/useMasterCoinsList.tsx @@ -36,12 +36,11 @@ const useMasterCoinsList = () => { const isStacksSwapsEnabled = useHasFeature(FeatureId.STACKS_SWAPS); const coinsMasterList = useMemo( - () => - [ - ...(runesFtList || []), - btcFt, - ...(!hideStx && isStacksSwapsEnabled ? [stxFt, ...(sip10FtList ?? [])] : []), - ] ?? [], + () => [ + ...(runesFtList || []), + btcFt, + ...(!hideStx && isStacksSwapsEnabled ? [stxFt, ...(sip10FtList ?? [])] : []), + ], [runesFtList, hideStx, isStacksSwapsEnabled, sip10FtList], ); diff --git a/src/app/screens/swap/useVisibleMasterCoinsList.tsx b/src/app/screens/swap/useVisibleMasterCoinsList.tsx index c50669170..d8d0a0267 100644 --- a/src/app/screens/swap/useVisibleMasterCoinsList.tsx +++ b/src/app/screens/swap/useVisibleMasterCoinsList.tsx @@ -14,13 +14,12 @@ const useVisibleMasterCoinsList = () => { const { hideStx } = useWalletSelector(); const coinsMasterList = useMemo( - () => - [ - ...sip10FtList, - ...runesFtList, - btcFt, - ...(!hideStx && isStacksSwapsEnabled ? [stxFt] : []), - ] ?? [], + () => [ + ...sip10FtList, + ...runesFtList, + btcFt, + ...(!hideStx && isStacksSwapsEnabled ? [stxFt] : []), + ], [sip10FtList, runesFtList, hideStx, isStacksSwapsEnabled], );