Bluesky app fork with some witchin' additions 馃挮
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 29 lines 751 B view raw
1import {Platform} from 'react-native' 2 3const onMouseUp = (e: React.MouseEvent & {target: HTMLElement}) => { 4 // Only handle whenever it is the middle button 5 if (e.button !== 1 || e.target.closest('a') || e.target.tagName === 'A') { 6 return 7 } 8 9 e.target.dispatchEvent( 10 new MouseEvent('click', {metaKey: true, bubbles: true}), 11 ) 12} 13 14const onMouseDown = (e: React.MouseEvent) => { 15 // Prevents the middle click scroll from enabling 16 if (e.button !== 1) return 17 e.preventDefault() 18} 19 20export function WebAuxClickWrapper({children}: React.PropsWithChildren<{}>) { 21 if (Platform.OS !== 'web') return children 22 23 return ( 24 // @ts-ignore web only 25 <div onMouseDown={onMouseDown} onMouseUp={onMouseUp}> 26 {children} 27 </div> 28 ) 29}