@@ -6,7 +6,7 @@ import { useRouter } from "expo-router";
66
77import { ChevronRight , CircleHelp , CreditCard , DollarSign , Eye , EyeOff , Hash , Snowflake } from "@tamagui/lucide-icons" ;
88import { useToastController } from "@tamagui/toast" ;
9- import { ScrollView , Separator , Spinner , Square , Switch , XStack , YStack } from "tamagui" ;
9+ import { ScrollView , Separator , Spinner , Square , XStack , YStack } from "tamagui" ;
1010
1111import { useMutation , useQuery } from "@tanstack/react-query" ;
1212
@@ -44,6 +44,7 @@ import LatestActivity from "../shared/LatestActivity";
4444import PluginUpgrade from "../shared/PluginUpgrade" ;
4545import SafeView from "../shared/SafeView" ;
4646import Skeleton from "../shared/Skeleton" ;
47+ import Switch from "../shared/Switch" ;
4748import Text from "../shared/Text" ;
4849import View from "../shared/View" ;
4950
@@ -347,6 +348,10 @@ export default function Card() {
347348 { cardDetails && (
348349 < >
349350 < XStack
351+ role = "switch"
352+ aria-checked = { displayStatus === "FROZEN" }
353+ aria-label = { t ( "Freeze card" ) }
354+ aria-disabled = { isFetchingCard || isSettingCardStatus }
350355 justifyContent = "space-between"
351356 paddingVertical = "$s4"
352357 alignItems = "center"
@@ -372,27 +377,9 @@ export default function Card() {
372377 { t ( "Freeze card" ) }
373378 </ Text >
374379 </ XStack >
375- < XStack alignItems = "center" justifyContent = "center" height = { 24 } >
376- < Switch
377- scale = { 0.9 }
378- margin = { 0 }
379- padding = "$s1"
380- pointerEvents = "none"
381- checked = { displayStatus === "FROZEN" }
382- backgroundColor = {
383- displayStatus === "FROZEN" ? "$backgroundBrandMild" : "$backgroundStrong"
384- }
385- borderWidth = { 0 }
386- height = { 24 }
387- width = { 60 }
388- >
389- < Switch . Thumb
390- checked = { displayStatus === "FROZEN" }
391- animation = "default"
392- backgroundColor = { displayStatus === "FROZEN" ? "$backgroundBrand" : "$backgroundSoft" }
393- />
394- </ Switch >
395- </ XStack >
380+ < Switch checked = { displayStatus === "FROZEN" } >
381+ < Switch . Thumb />
382+ </ Switch >
396383 </ XStack >
397384 < Separator borderColor = "$borderNeutralSoft" />
398385 </ >
0 commit comments