Live video on the AT Protocol
at eli/github-skip-darwin 38 lines 693 B view raw
1import { Text, useMedia, View } from "tamagui"; 2 3export default function BreakpointIndicator() { 4 const media = useMedia(); 5 const breakpoints: (keyof typeof media)[] = [ 6 "xs", 7 "sm", 8 "md", 9 "lg", 10 "xl", 11 "xxl", 12 "gtXl", 13 ]; 14 15 // Find the first matching breakpoint 16 let current = "default"; 17 for (const key of breakpoints) { 18 if (media[key]) { 19 current = key; 20 break; 21 } 22 } 23 24 return ( 25 <View 26 borderRadius={999} 27 backgroundColor="$blue10Dark" 28 height="$2" 29 width="$2" 30 alignItems="center" 31 justifyContent="center" 32 > 33 <Text fontSize="$5" color="$color"> 34 {current} 35 </Text> 36 </View> 37 ); 38}