Commit 3f4e4f9 1 parent 2aa5562 commit 3f4e4f9 Copy full SHA for 3f4e4f9
File tree 5 files changed +17
-7
lines changed
5 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 29
29
absolute
30
30
right-2
31
31
ml-2
32
- md:visible
33
- [& > kbd]: font- ibm- plex- mono;
32
+ font-ibm-plex-mono
33
+ motion-safe:transition-opacity
34
+ motion-safe:duration-100
35
+ md:visible;
34
36
}
Original file line number Diff line number Diff line change 1
1
'use client' ;
2
2
3
3
import { MagnifyingGlassIcon } from '@heroicons/react/24/outline' ;
4
+ import classNames from 'classnames' ;
4
5
import { useTranslations } from 'next-intl' ;
5
6
import { useState , type FC } from 'react' ;
6
7
@@ -31,6 +32,7 @@ export const SearchButton: FC = () => {
31
32
const { os } = useDetectOS ( ) ;
32
33
33
34
const osCommandKey = os === 'MAC' ? '⌘' : 'Ctrl' ;
35
+ const isOSLoading = os === 'LOADING' ;
34
36
35
37
return (
36
38
< >
@@ -42,9 +44,14 @@ export const SearchButton: FC = () => {
42
44
< MagnifyingGlassIcon className = { styles . magnifyingGlassIcon } />
43
45
44
46
{ t ( 'components.search.searchBox.placeholder' ) }
45
- < span title = { `${ osCommandKey } K` } className = { styles . shortcutIndicator } >
46
- < kbd > { osCommandKey } K</ kbd >
47
- </ span >
47
+ < kbd
48
+ title = { `${ osCommandKey } K` }
49
+ className = { classNames ( styles . shortcutIndicator , {
50
+ 'opacity-0' : isOSLoading ,
51
+ } ) }
52
+ >
53
+ < abbr > { osCommandKey } K</ abbr >
54
+ </ kbd >
48
55
</ button >
49
56
50
57
{ isOpen ? < WithSearchBox onClose = { closeSearchBox } /> : null }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ type UserOSState = {
15
15
16
16
const useDetectOS = ( ) => {
17
17
const [ userOSState , setUserOSState ] = useState < UserOSState > ( {
18
- os : 'OTHER ' ,
18
+ os : 'LOADING ' ,
19
19
bitness : 86 ,
20
20
architecture : 'ARM' ,
21
21
} ) ;
Original file line number Diff line number Diff line change 1
- export type UserOS = 'MAC' | 'WIN' | 'LINUX' | 'OTHER' ;
1
+ export type UserOS = 'MAC' | 'WIN' | 'LINUX' | 'OTHER' | 'LOADING' ;
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ export const bitnessItems = {
91
91
} ,
92
92
] ,
93
93
OTHER : [ ] ,
94
+ LOADING : [ ] ,
94
95
} ;
95
96
96
97
type formatDropdownItemsType = {
You can’t perform that action at this time.
0 commit comments