mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-23 00:16:19 -05:00
Adding videos page hotkeys to help play and navigate videos. Adding f hotkey for all local search fields (channel/domain/etc). Focusing when opening cookie modals.
This commit is contained in:
parent
21c96d9501
commit
ad0d93714a
8 changed files with 166 additions and 14 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import React, {useState} from "react";
|
||||
import {useHotkeys} from "react-hotkeys-hook";
|
||||
import {Grid, StatisticLabel, StatisticValue,} from "semantic-ui-react";
|
||||
import {createChannel, deleteChannel, refreshChannel, tagChannel, tagChannelInfo} from "../api";
|
||||
import {CollectionTagModal} from "./collections/CollectionTagModal";
|
||||
|
|
@ -523,6 +524,14 @@ export function ChannelsPage() {
|
|||
|
||||
const [channels] = useChannels();
|
||||
const [searchStr, setSearchStr] = useOneQuery('name');
|
||||
const searchInputRef = React.useRef();
|
||||
|
||||
useHotkeys('f', (e) => {
|
||||
e.preventDefault();
|
||||
if (searchInputRef.current) {
|
||||
searchInputRef.current.focus();
|
||||
}
|
||||
}, {enableOnFormTags: false});
|
||||
|
||||
// Header section matching DomainsPage pattern
|
||||
const header = <div style={{marginBottom: '1em'}}>
|
||||
|
|
@ -537,6 +546,7 @@ export function ChannelsPage() {
|
|||
onClear={() => setSearchStr('')}
|
||||
onChange={setSearchStr}
|
||||
onSubmit={null}
|
||||
inputRef={searchInputRef}
|
||||
/>
|
||||
</Grid.Column>
|
||||
<Grid.Column textAlign='right'>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue