Commit 0702ef3 1 parent 13d4cf2 commit 0702ef3 Copy full SHA for 0702ef3
File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 23
23
top-[8px ]
24
24
size-5;
25
25
}
26
+
27
+ .shortcutIndicator {
28
+ @apply invisible
29
+ absolute
30
+ right-2
31
+ ml-2
32
+ md:visible
33
+ [& > kbd]: font- ibm- plex- mono;
34
+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { useTranslations } from 'next-intl';
5
5
import { useState , type FC } from 'react' ;
6
6
7
7
import { WithSearchBox } from '@/components/Common/Search/States/WithSearchBox' ;
8
+ import { useDetectOS } from '@/hooks' ;
8
9
import { useKeyboardCommands } from '@/hooks/react-client' ;
9
10
10
11
import styles from './index.module.css' ;
@@ -27,6 +28,10 @@ export const SearchButton: FC = () => {
27
28
}
28
29
} ) ;
29
30
31
+ const { os } = useDetectOS ( ) ;
32
+
33
+ const osCommandKey = os === 'MAC' ? '⌘' : 'Ctrl' ;
34
+
30
35
return (
31
36
< >
32
37
< button
@@ -37,6 +42,9 @@ export const SearchButton: FC = () => {
37
42
< MagnifyingGlassIcon className = { styles . magnifyingGlassIcon } />
38
43
39
44
{ t ( 'components.search.searchBox.placeholder' ) }
45
+ < span title = { `${ osCommandKey } K` } className = { styles . shortcutIndicator } >
46
+ < kbd > { osCommandKey } K</ kbd >
47
+ </ span >
40
48
</ button >
41
49
42
50
{ isOpen ? < WithSearchBox onClose = { closeSearchBox } /> : null }
You can’t perform that action at this time.
0 commit comments