diff --git a/src/__swaps__/screens/Swap/components/AnimatedSwitch.tsx b/src/__swaps__/screens/Swap/components/AnimatedSwitch.tsx index 7a344be6a26..9f2032ca3a6 100644 --- a/src/__swaps__/screens/Swap/components/AnimatedSwitch.tsx +++ b/src/__swaps__/screens/Swap/components/AnimatedSwitch.tsx @@ -12,9 +12,10 @@ type AnimatedSwitchProps = { value: SharedValue; activeLabel?: string; inactiveLabel?: string; + disabled?: boolean; } & Omit; -export function AnimatedSwitch({ value, onToggle, activeLabel, inactiveLabel, ...props }: AnimatedSwitchProps) { +export function AnimatedSwitch({ value, onToggle, activeLabel, inactiveLabel, disabled = false, ...props }: AnimatedSwitchProps) { const { isDarkMode } = useColorMode(); const inactiveBg = useForegroundColor('fillSecondary'); @@ -27,6 +28,7 @@ export function AnimatedSwitch({ value, onToggle, activeLabel, inactiveLabel, .. ? withTiming(opacityWorklet(inactiveBg, 0.12), TIMING_CONFIGS.fadeConfig) : withTiming(opacityWorklet(activeBg, 0.64), TIMING_CONFIGS.fadeConfig), borderColor: opacityWorklet(border, 0.06), + opacity: disabled ? 0.4 : 1, }; }); @@ -41,6 +43,8 @@ export function AnimatedSwitch({ value, onToggle, activeLabel, inactiveLabel, .. }); const labelItem = useDerivedValue(() => { + if (disabled) return; + if (!activeLabel && !inactiveLabel) { return; } diff --git a/src/__swaps__/screens/Swap/components/ReviewPanel.tsx b/src/__swaps__/screens/Swap/components/ReviewPanel.tsx index 4ebca35d4a7..8343d2f4170 100644 --- a/src/__swaps__/screens/Swap/components/ReviewPanel.tsx +++ b/src/__swaps__/screens/Swap/components/ReviewPanel.tsx @@ -34,6 +34,7 @@ import { useNavigation } from '@/navigation'; import Routes from '@/navigation/routesNames'; import { ethereumUtils } from '@/utils'; import { getNativeAssetForNetwork } from '@/utils/ethereumUtils'; +import { getNetworkObj } from '@/networks'; import { chainNameFromChainId } from '@/__swaps__/utils/chains'; const UNKNOWN_LABEL = i18n.t(i18n.l.swap.unknown); @@ -119,6 +120,24 @@ function EstimatedArrivalTime() { ); } +function FlashbotsToggle() { + const { SwapSettings } = useSwapContext(); + + const inputAssetChainId = swapsStore(state => state.inputAsset?.chainId) ?? ChainId.mainnet; + const isFlashbotsEnabledForNetwork = getNetworkObj(ethereumUtils.getNetworkFromChainId(inputAssetChainId)).features.flashbots; + const flashbotsToggleValue = useDerivedValue(() => isFlashbotsEnabledForNetwork && SwapSettings.flashbots.value); + + return ( + + ); +} + export function ReviewPanel() { const { navigate } = useNavigation(); const { isDarkMode } = useColorMode(); @@ -266,12 +285,7 @@ export function ReviewPanel() { - +