Bluesky app fork with some witchin' additions 馃挮
at main 53 lines 1.3 kB view raw
1import {type StyleProp, View, type ViewStyle} from 'react-native' 2import {Trans} from '@lingui/react/macro' 3 4import {atoms as a, tokens, useTheme} from '#/alf' 5import {Text} from '#/components/Typography' 6 7export function LiveIndicator({ 8 size = 'small', 9 style, 10}: { 11 size?: 'tiny' | 'small' | 'large' 12 style?: StyleProp<ViewStyle> 13}) { 14 const t = useTheme() 15 16 const fontSize = { 17 tiny: {fontSize: 7, letterSpacing: tokens.TRACKING}, 18 small: a.text_2xs, 19 large: a.text_xs, 20 }[size] 21 22 return ( 23 <View 24 style={[ 25 a.absolute, 26 a.w_full, 27 a.align_center, 28 a.pointer_events_none, 29 {bottom: size === 'large' ? -8 : -5}, 30 style, 31 ]}> 32 <View 33 style={{ 34 backgroundColor: t.palette.negative_500, 35 paddingVertical: size === 'large' ? 2 : 1, 36 paddingHorizontal: size === 'large' ? 4 : 3, 37 borderRadius: size === 'large' ? 5 : tokens.borderRadius.xs, 38 }}> 39 <Text 40 style={[ 41 a.text_center, 42 a.font_semi_bold, 43 fontSize, 44 {color: t.palette.white}, 45 ]}> 46 <Trans comment="Live status indicator on avatar. Should be extremely short, not much space for more than 4 characters"> 47 LIVE 48 </Trans> 49 </Text> 50 </View> 51 </View> 52 ) 53}