mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-13 11:15:27 +00:00
Allow meta + K shortcut for search, use npm not yarn.
This commit is contained in:
parent
30f113cdb9
commit
1051acbe88
@ -77,7 +77,14 @@ const Search: React.FunctionComponent<SearchProps> = (props) => {
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
const handleKeyPress = useCallback(
|
||||
(event: KeyboardEvent) => {
|
||||
if (event.key == '/' && !isOpen) {
|
||||
if (event.key === 'k' && (event.metaKey || event.ctrlKey) && isOpen) {
|
||||
setIsOpen(false)
|
||||
event.preventDefault()
|
||||
} else if (
|
||||
(event.key == '/' ||
|
||||
(event.key === 'k' && (event.metaKey || event.ctrlKey))) &&
|
||||
!isOpen
|
||||
) {
|
||||
setIsOpen(true)
|
||||
event.preventDefault()
|
||||
}
|
||||
@ -127,7 +134,7 @@ const Search: React.FunctionComponent<SearchProps> = (props) => {
|
||||
return (
|
||||
<>
|
||||
<div className="flex items-center ml-2">
|
||||
<button onClick={openModal} title="Search (/)">
|
||||
<button onClick={openModal} title="Search (/ or ⌘K)">
|
||||
<SearchIcon size={32} />
|
||||
</button>
|
||||
</div>
|
||||
@ -158,7 +165,7 @@ const Search: React.FunctionComponent<SearchProps> = (props) => {
|
||||
<SearchIcon size={32} />
|
||||
</Combobox.Label>
|
||||
<Combobox.Input
|
||||
placeholder="Search docs (/)"
|
||||
placeholder="Search docs (/ or ⌘K)"
|
||||
className="mx-1 p-2 w-full bg-gray-200 dark:bg-gray-800 outline-none"
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
/>
|
||||
|
@ -1,5 +1,5 @@
|
||||
[build]
|
||||
command = "yarn run build"
|
||||
command = "npm run build"
|
||||
publish = ".next"
|
||||
|
||||
# Include the doc dir in the build ignore command
|
||||
|
26295
web/package-lock.json
generated
Normal file
26295
web/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -50,7 +50,7 @@
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-mdx": "^2.0.5",
|
||||
"js-yaml": "^4.1.0",
|
||||
"netlify-plugin-cypress": "~2.2.0",
|
||||
"netlify-plugin-cypress": "^2.2.0",
|
||||
"next-mdx-remote": "^4.1.0",
|
||||
"next-remote-watch": "2.0.0",
|
||||
"postcss": "^8.4.4",
|
||||
@ -58,7 +58,6 @@
|
||||
"remark-gfm": "^3.0.1",
|
||||
"tailwindcss": "^3.1.0",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-airbnb": "^5.11.2",
|
||||
"typescript": "^4.8.3"
|
||||
}
|
||||
}
|
||||
|
8665
web/yarn.lock
8665
web/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user