-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ctrl+space keyboard shortcut
resolves #49
- Loading branch information
Showing
9 changed files
with
137 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from 'react' | ||
import Browser from 'utils/Browser' | ||
|
||
const KeyboardShortcut = () => { | ||
return ( | ||
<section className="flex flex-row justify-between items-center gap-8"> | ||
<div className="flex flex-col"> | ||
<strong>Keyboard shortcut</strong> | ||
<label> | ||
The default keyboard shortcut for opening the search popup is | ||
<kbd>Ctrl</kbd><kbd>Space</kbd> | ||
. To customise it, | ||
{ | ||
Browser.isChrome ? | ||
( | ||
<> | ||
click | ||
<a | ||
className="text-blue-700 border-0 bg-none outline-none p-0 underline cursor-pointer select-text hover:text-blue-900" | ||
href="chrome://extensions/shortcuts" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
here | ||
</a> | ||
. | ||
</> | ||
) : ( | ||
<> | ||
visit | ||
<a | ||
className="text-blue-700 border-0 bg-none outline-none p-0 underline cursor-pointer select-text hover:text-blue-900" | ||
href="about:addons" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
about:addons | ||
</a> | ||
and click "Manage Extension Shortcuts", as shown in | ||
<a | ||
className="text-blue-700 border-0 bg-none outline-none p-0 underline cursor-pointer select-text hover:text-blue-900" | ||
href="https://bug1303384.bmoattachments.org/attachment.cgi?id=9051647" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
this video | ||
</a> | ||
</> | ||
) | ||
} | ||
</label> | ||
</div> | ||
</section> | ||
) | ||
} | ||
|
||
export default KeyboardShortcut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { useEffect, useRef } from 'react' | ||
|
||
const useFocusInput = () => { | ||
const inputReference = useRef(null) | ||
|
||
useEffect(() => { | ||
if (inputReference.current) { | ||
inputReference.current.focus() | ||
} | ||
}, []) | ||
|
||
return inputReference | ||
} | ||
|
||
export default useFocusInput |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters