File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 2323 top-[8px ]
2424 size-5;
2525}
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';
55import { useState , type FC } from 'react' ;
66
77import { WithSearchBox } from '@/components/Common/Search/States/WithSearchBox' ;
8+ import { useDetectOS } from '@/hooks' ;
89import { useKeyboardCommands } from '@/hooks/react-client' ;
910
1011import styles from './index.module.css' ;
@@ -27,6 +28,10 @@ export const SearchButton: FC = () => {
2728 }
2829 } ) ;
2930
31+ const { os } = useDetectOS ( ) ;
32+
33+ const osCommandKey = os === 'MAC' ? '⌘' : 'Ctrl' ;
34+
3035 return (
3136 < >
3237 < button
@@ -37,6 +42,9 @@ export const SearchButton: FC = () => {
3742 < MagnifyingGlassIcon className = { styles . magnifyingGlassIcon } />
3843
3944 { t ( 'components.search.searchBox.placeholder' ) }
45+ < span title = { `${ osCommandKey } K` } className = { styles . shortcutIndicator } >
46+ < kbd > { osCommandKey } K</ kbd >
47+ </ span >
4048 </ button >
4149
4250 { isOpen ? < WithSearchBox onClose = { closeSearchBox } /> : null }
You can’t perform that action at this time.
0 commit comments