Something went wrong. Try again.
Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031import {Platform} from 'react-native'import type React from 'react'
const onMouseUp = (e: React.MouseEvent & {target: HTMLElement}) => { // Only handle whenever it is the middle button if (e.button !== 1 || e.target.closest('a') || e.target.tagName === 'A') { return }
e.target.dispatchEvent( new MouseEvent('click', {metaKey: true, bubbles: true}), )}
const onMouseDown = (e: React.MouseEvent) => { // Prevents the middle click scroll from enabling if (e.button !== 1) return e.preventDefault()}
export function WebAuxClickWrapper({children}: React.PropsWithChildren<{}>) { if (Platform.OS !== 'web') return children
return ( // @ts-ignore web only <div onMouseDown={onMouseDown} onMouseUp={onMouseUp}> {children} </div> )}