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