diff --git a/apps/playground/src/components/menu/Menu.tsx b/apps/playground/src/components/menu/Menu.tsx index 94c2d7f7..70edbd58 100644 --- a/apps/playground/src/components/menu/Menu.tsx +++ b/apps/playground/src/components/menu/Menu.tsx @@ -2,6 +2,7 @@ import { For, createSignal, onCleanup, onMount } from 'solid-js'; import { setSettings, settings, type Settings } from '../../hooks/useSettings'; import { useWorkspaces, type Workspace } from '../../indexeddb'; import { openFile } from '../../utils/files'; +import { ctrlCmdIcon } from '../../utils/platform'; import MenuButton from './MenuButton'; import MenuDropdown from './MenuDropdown'; import MenuHeader from './MenuHeader'; @@ -42,7 +43,7 @@ export default function Menu(props: Props) { onOpen={() => setOpenedMenu('file')} > openFile(props.onFileOpen)} > Open File… @@ -62,7 +63,7 @@ export default function Menu(props: Props) { )} - + Save diff --git a/apps/playground/src/utils/platform.ts b/apps/playground/src/utils/platform.ts new file mode 100644 index 00000000..017e1bca --- /dev/null +++ b/apps/playground/src/utils/platform.ts @@ -0,0 +1,9 @@ +const isMacintosh = navigator.userAgent.includes('Macintosh'); +const isIOS = + (navigator.userAgent.includes('Macintosh') || + navigator.userAgent.includes('iPad') || + navigator.userAgent.includes('iPhone')) && + !!navigator.maxTouchPoints && + navigator.maxTouchPoints > 0; + +export const ctrlCmdIcon = isMacintosh || isIOS ? '⌘' : 'Ctrl';