diff --git a/web/containers/ShortcutModal/index.tsx b/web/containers/ShortcutModal/index.tsx new file mode 100644 index 000000000..638df02d8 --- /dev/null +++ b/web/containers/ShortcutModal/index.tsx @@ -0,0 +1,99 @@ +import React from 'react' + +import { + Modal, + ModalTrigger, + Button, + ModalContent, + ModalHeader, + ModalTitle, +} from '@janhq/uikit' + +const availableShortcuts = [ + { + combination: 'E', + modifierKeys: [isMac ? '⌘' : 'Ctrl'], + description: 'Show list your models', + }, + { + combination: 'K', + modifierKeys: [isMac ? '⌘' : 'Ctrl'], + description: 'Show list navigation pages', + }, + { + combination: 'B', + modifierKeys: [isMac ? '⌘' : 'Ctrl'], + description: 'Toggle collapsible left panel', + }, + { + combination: ',', + modifierKeys: [isMac ? '⌘' : 'Ctrl'], + description: 'Navigate to setting page', + }, + { + combination: 'Enter', + description: 'Send a message', + }, + { + combination: 'Shift + Enter', + description: 'Insert new line in input box', + }, + { + combination: 'Arrow Up', + description: 'Navigate to previous option (within search dialog)', + }, + { + combination: 'Arrow Down', + description: 'Navigate to next option (within search dialog)', + }, +] + +const ShortcutModal: React.FC = () => ( + + + + + + + Keyboard Shortcuts + +
+
+
+
Combination
+
+
+
Description
+
+
+ {availableShortcuts.map((shortcut, index) => { + return ( +
+
+
+

{`${shortcut.modifierKeys?.[0] ?? ''} ${ + shortcut.combination + }`}

+
+
+
+

{shortcut.description}

+
+
+ ) + })} +
+
+
+) + +export default ShortcutModal diff --git a/web/screens/Settings/Advanced/index.tsx b/web/screens/Settings/Advanced/index.tsx index 9a25b0f35..03b840f0b 100644 --- a/web/screens/Settings/Advanced/index.tsx +++ b/web/screens/Settings/Advanced/index.tsx @@ -4,24 +4,16 @@ import { useContext, useEffect, useState } from 'react' import { fs } from '@janhq/core' -import { - Switch, - Button, - Modal, - ModalContent, - ModalHeader, - ModalTitle, - ModalTrigger, -} from '@janhq/uikit' +import { Switch, Button } from '@janhq/uikit' import { atom, useAtom } from 'jotai' -import ShortCut from '@/containers/Shortcut' +import ShortcutModal from '@/containers/ShortcutModal' +import { toaster } from '@/containers/Toast' import { FeatureToggleContext } from '@/context/FeatureToggle' import { useSettings } from '@/hooks/useSettings' -import { toaster } from '@/containers/Toast' const serverEnabledAtom = atom(false) @@ -173,136 +165,7 @@ const Advanced = () => { Shortcuts that you might find useful in Jan app.

- - - - - - - Keyboard Shortcuts - -
-
-
-
-
Combination
-
-
-
-
-
Description
-
-
-
-
-
-
- -
-
-
-
-

Show list your models

-
-
-
-
-
-
- -
-
-
-
-

Show list navigation pages

-
-
-
-
-
-
- -
-
-
-
-

Toggle collapsible left panel

-
-
-
-
-
-
- -
-
-
-
-

Navigate to setting page

-
-
-
-
-
-
-
-

Enter

-
-
-
-
-
-

Send a message

-
-
-
-
-
-
-
-

Shift + Enter

-
-
-
-
-
-

Insert new line in input box

-
-
-
-
-
-
-
-

Arrow Up

-
-
-
-
-
-

Navigate to previous option (within search dialog)

-
-
-
-
-
-
-
-

Arrow Down

-
-
-
-
-
-

Navigate to next option (within search dialog)

-
-
-
-
-
-
+ )