Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
nonceSortedPendingTransactionsSelectorAllChains,
} from '../../../selectors/transactions';
import {
getCurrentNetwork,
getSelectedAccount,
getShouldHideZeroBalanceTokens,
getSelectedMultichainNetworkChainId,
Expand All @@ -37,7 +36,7 @@
import { SWAPS_CHAINID_CONTRACT_ADDRESS_MAP } from '../../../../shared/constants/swaps';
import { isEqualCaseInsensitive } from '../../../../shared/modules/string-utils';
import {
getIsEvmMultichainNetworkSelected,

Check failure on line 39 in ui/components/app/transaction-list/unified-transaction-list.component.js

View workflow job for this annotation

GitHub Actions / test-lint / Test lint

'getIsEvmMultichainNetworkSelected' is defined but never used
getAllEnabledNetworksForAllNamespaces,
///: BEGIN:ONLY_INCLUDE_IF(multichain)
getSelectedMultichainNetworkConfiguration,
Expand Down Expand Up @@ -88,16 +87,10 @@
///: END:ONLY_INCLUDE_IF

import { endTrace, TraceName } from '../../../../shared/lib/trace';
import { TEST_CHAINS } from '../../../../shared/constants/network';
///: BEGIN:ONLY_INCLUDE_IF(multichain)
import { MULTICHAIN_TOKEN_IMAGE_MAP } from '../../../../shared/constants/multichain/networks';
///: END:ONLY_INCLUDE_IF
// eslint-disable-next-line import/no-restricted-paths
import { getEnvironmentType } from '../../../../app/scripts/lib/util';
import {
ENVIRONMENT_TYPE_NOTIFICATION,
ENVIRONMENT_TYPE_POPUP,
} from '../../../../shared/constants/app';
import AssetListControlBar from '../assets/asset-list/asset-list-control-bar';
import {
startIncomingTransactionPolling,
Expand Down Expand Up @@ -412,7 +405,6 @@
}) {
const [daysLimit, setDaysLimit] = useState(PAGE_DAYS_INCREMENT);
const t = useI18nContext();
const currentNetworkConfig = useSelector(getCurrentNetwork);
const selectedAccount = useSelector(getSelectedAccount);
const enabledNetworks = useSelector(getEnabledNetworks);

Expand Down Expand Up @@ -442,16 +434,10 @@
return unfilteredPendingTransactionsAllChains;
}, [unfilteredPendingTransactionsAllChains]);

const isTestNetwork = useMemo(() => {
return TEST_CHAINS.includes(currentNetworkConfig.chainId);
}, [currentNetworkConfig.chainId]);

const unfilteredCompletedTransactionsAllChains = useSelector(
nonceSortedCompletedTransactionsSelectorAllChains,
);

const isEvmNetwork = useSelector(getIsEvmMultichainNetworkSelected);

const enabledNetworksForAllNamespaces = useSelector(
getAllEnabledNetworksForAllNamespaces,
);
Expand Down Expand Up @@ -529,14 +515,6 @@
const isBuyableChain = useSelector(getIsNativeTokenBuyable);
const showRampsCard = isBuyableChain && balanceIsZero;

const [isNetworkFilterPopoverOpen, setIsNetworkFilterPopoverOpen] =
useState(false);

const windowType = getEnvironmentType();
const isFullScreen =
windowType !== ENVIRONMENT_TYPE_NOTIFICATION &&
windowType !== ENVIRONMENT_TYPE_POPUP;

useEffect(() => {
stopIncomingTransactionPolling();
startIncomingTransactionPolling();
Expand All @@ -554,37 +532,6 @@
[],
);

const toggleNetworkFilterPopover = useCallback(() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was unnecessary as a callback.

More importantly the dependencies imported here aren't used in this component

setIsNetworkFilterPopoverOpen(!isNetworkFilterPopoverOpen);
}, [isNetworkFilterPopoverOpen]);

const closePopover = useCallback(() => {
setIsNetworkFilterPopoverOpen(false);
}, []);

const renderFilterButton = useCallback(() => {
if (hideNetworkFilter) {
return null;
}

return (
<AssetListControlBar
showSortControl={false}
showTokenFiatBalance={false}
showImportTokenButton={false}
/>
);
}, [
hideNetworkFilter,
isEvmNetwork,
isFullScreen,
isNetworkFilterPopoverOpen,
currentNetworkConfig,
toggleNetworkFilterPopover,
closePopover,
isTestNetwork,
]);

useEffect(() => {
endTrace({ name: TraceName.AccountOverviewActivityTab });
}, []);
Expand Down Expand Up @@ -735,7 +682,13 @@
))}

<Box className="transaction-list" {...boxProps}>
{renderFilterButton()}
{!hideNetworkFilter && (
<AssetListControlBar
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simply inline here

showSortControl={false}
showTokenFiatBalance={false}
showImportTokenButton={false}
/>
)}
{showRampsCard ? (
<RampsCard variant={RAMPS_CARD_VARIANT_TYPES.ACTIVITY} />
) : null}
Expand Down
Loading