mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-24 02:02:42 +00:00
Use mobile action sheets and long-press file menus while preserving provider context across sheet portals. Keep sidebar and file-pane glyphs on shared visual rails, avoid scrollbar layout shifts, and hide keyboard affordances where shortcuts are unavailable.
20 lines
522 B
TypeScript
20 lines
522 B
TypeScript
import { useIsCompactFormFactor } from "@/constants/layout";
|
|
import { isNative } from "@/constants/platform";
|
|
|
|
interface KeyboardShortcutEnvironment {
|
|
isNative: boolean;
|
|
isCompact: boolean;
|
|
}
|
|
|
|
export function keyboardShortcutsAvailable({
|
|
isNative: native,
|
|
isCompact,
|
|
}: KeyboardShortcutEnvironment): boolean {
|
|
return !native && !isCompact;
|
|
}
|
|
|
|
export function useKeyboardShortcutsAvailable(): boolean {
|
|
const isCompact = useIsCompactFormFactor();
|
|
return keyboardShortcutsAvailable({ isNative, isCompact });
|
|
}
|