Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

feat: right click for long-press button actions

xan.lol f16d9b2b d9d617be

+15 -2
+15 -2
src/components/Button.tsx
··· 235 235 const onPointerLeave = useCallback(() => { 236 236 clearLongPressTimer() 237 237 }, [clearLongPressTimer]) 238 + const onContextMenu = useCallback( 239 + (e: Event) => { 240 + if (!onLongPressOuter || !IS_WEB || IS_WEB_TOUCH_DEVICE) return 241 + 242 + e.preventDefault() 243 + clearLongPressTimer() 244 + longPressTriggeredRef.current = true 245 + onLongPressOuter(e as unknown as GestureResponderEvent) 246 + }, 247 + [clearLongPressTimer, onLongPressOuter], 248 + ) 238 249 const onHoverIn = useCallback( 239 250 (e: MouseEvent) => { 240 251 setState(s => ({ ··· 604 615 onPointerDown, 605 616 onPointerUp, 606 617 onPointerLeave, 607 - onContextMenu: (e: Event) => e.preventDefault(), 618 + onContextMenu, 608 619 } 609 620 : {}) as any)} 610 621 // @ts-ignore - this will always be a pressable ··· 630 641 onPressIn={onPressIn} 631 642 onPressOut={onPressOut} 632 643 onPress={onPress} 633 - onLongPress={!IS_WEB || IS_WEB_TOUCH_DEVICE ? onLongPressOuter : undefined} 644 + onLongPress={ 645 + !IS_WEB || IS_WEB_TOUCH_DEVICE ? onLongPressOuter : undefined 646 + } 634 647 onHoverIn={onHoverIn} 635 648 onHoverOut={onHoverOut} 636 649 onFocus={onFocus}