From 760f624fcc3a24e82ec795b1376a5874b5ac2ad5 Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Fri, 20 Dec 2024 10:15:30 -0500 Subject: [PATCH] fix network colors for network switcher --- src/components/NetworkSwitcher.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/NetworkSwitcher.tsx b/src/components/NetworkSwitcher.tsx index 65a66961d7a..61394cdc5d4 100644 --- a/src/components/NetworkSwitcher.tsx +++ b/src/components/NetworkSwitcher.tsx @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { getChainColorWorklet, opacity } from '@/__swaps__/utils/swaps'; +import { opacity } from '@/__swaps__/utils/swaps'; import { useBackendNetworksStore } from '@/state/backendNetworks/backendNetworks'; import { ChainId } from '@/state/backendNetworks/types'; import { AnimatedBlurView } from '@/components/AnimatedComponents/AnimatedBlurView'; @@ -48,6 +48,7 @@ import { noop } from 'lodash'; import { TapToDismiss } from './DappBrowser/control-panel/ControlPanel'; import { THICK_BORDER_WIDTH } from '@/__swaps__/screens/Swap/constants'; import { GestureHandlerButton } from '@/__swaps__/screens/Swap/components/GestureHandlerButton'; +import { useTheme } from '@/theme'; const t = i18n.l.network_switcher; @@ -372,8 +373,9 @@ function AllNetworksSection({ } function NetworkOption({ chainId, selected }: { chainId: ChainId; selected: SharedValue }) { + const { colors } = useTheme(); const chainName = useBackendNetworksStore.getState().getChainsLabel()[chainId]; - const chainColor = getChainColorWorklet(chainId, true); + const chainColor = colors.networkColors[chainId] ? colors.networkColors[chainId] : undefined; const isSelected = useDerivedValue(() => selected.value === chainId); const { animatedStyle } = useNetworkOptionStyle(isSelected, chainColor);