feat(mobile): disable tooltips, render context menus as bottom sheets

This commit is contained in:
Jannis Braun
2026-03-17 15:44:46 +01:00
parent 183290ef07
commit a073613b43
2 changed files with 39 additions and 1 deletions
@@ -1,6 +1,7 @@
import React, { useState, useRef, useEffect } from 'react';
import { createPortal } from 'react-dom';
import { useFloatingPosition } from '../../hooks/useFloatingPosition';
import { useUIStore } from '../../stores/uiStore';
interface TooltipProps {
content: string;
@@ -10,6 +11,10 @@ interface TooltipProps {
}
export function Tooltip({ content, children, position = 'right', delay = 200 }: TooltipProps) {
const isMobile = useUIStore((s) => s.isMobile);
// No tooltips on touch devices — return children unwrapped
if (isMobile) return <>{children}</>;
const [isVisible, setIsVisible] = useState(false);
const timeoutRef = useRef<ReturnType<typeof setTimeout>>();
const anchorRef = useRef<HTMLDivElement>(null);