An ATproto social media client -- with an independent Appview.
at main 643 B view raw
1import {View} from 'react-native' 2 3import {atoms as a, useTheme, type ViewStyleProp} from '#/alf' 4 5export function SubtleHover({style, hover}: ViewStyleProp & {hover: boolean}) { 6 const t = useTheme() 7 8 let opacity: number 9 switch (t.name) { 10 case 'dark': 11 opacity = 0.4 12 break 13 case 'dim': 14 opacity = 0.45 15 break 16 case 'light': 17 opacity = 0.5 18 break 19 } 20 21 return ( 22 <View 23 style={[ 24 a.absolute, 25 a.inset_0, 26 a.pointer_events_none, 27 a.transition_opacity, 28 t.atoms.bg_contrast_25, 29 style, 30 {opacity: hover ? opacity : 0}, 31 ]} 32 /> 33 ) 34}