-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keyboard navigation for search facets
- Loading branch information
1 parent
4ec6ebd
commit 029358b
Showing
4 changed files
with
321 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { noop } from '@utils'; | ||
import { createContext, Dispatch, SetStateAction } from 'react'; | ||
import { KeyboardFocusItem } from './types'; | ||
|
||
export const FacetContext = createContext<{ | ||
keyboardFocus: KeyboardFocusItem; | ||
setKeyboardFocus: Dispatch<SetStateAction<KeyboardFocusItem>>; | ||
expanded: string[]; | ||
setExpanded: Dispatch<SetStateAction<string[]>>; | ||
childrenCount: { | ||
[key: string]: number; | ||
}; | ||
setChildrenCount: Dispatch< | ||
SetStateAction<{ | ||
[key: string]: number; | ||
}> | ||
>; | ||
}>({ | ||
keyboardFocus: null, | ||
setKeyboardFocus: noop, | ||
expanded: [], | ||
setExpanded: noop, | ||
childrenCount: {}, | ||
setChildrenCount: noop, | ||
}); |
Oops, something went wrong.