Skip to content

Commit

Permalink
fix network colors for network switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Dec 20, 2024
1 parent 572edec commit 760f624
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/NetworkSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -372,8 +373,9 @@ function AllNetworksSection({
}

function NetworkOption({ chainId, selected }: { chainId: ChainId; selected: SharedValue<ChainId | undefined> }) {
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);

Expand Down

0 comments on commit 760f624

Please sign in to comment.