Refactor hotkyes in its own lib folder (#660)

* Refactor hotkyes in its own lib folder

* Lint

* Fix PR comments

* rename hotkeysScope into hotkeyScope
This commit is contained in:
Charles Bochet
2023-07-14 12:27:26 -07:00
committed by GitHub
parent 7bcea343e2
commit e93a96b3b1
71 changed files with 398 additions and 386 deletions

View File

@ -1,7 +1,6 @@
import { ReactNode, useCallback, useState } from 'react';
import styled from '@emotion/styled';
import { InternalHotkeysScope } from '@/hotkeys/types/internal/InternalHotkeysScope';
import { FilterDropdownButton } from '@/lib/filters-and-sorts/components/FilterDropdownButton';
import SortAndFilterBar from '@/lib/filters-and-sorts/components/SortAndFilterBar';
import { SortDropdownButton } from '@/lib/filters-and-sorts/components/SortDropdownButton';
@ -9,6 +8,7 @@ import {
SelectedSortType,
SortType,
} from '@/lib/filters-and-sorts/interfaces/sorts/interface';
import { FiltersHotkeyScope } from '@/lib/filters-and-sorts/types/FiltersHotkeyScope';
import { TableContext } from '@/ui/tables/states/TableContext';
type OwnProps<SortField> = {
@ -93,13 +93,13 @@ export function TableHeader<SortField>({
<StyledFilters>
<FilterDropdownButton
context={TableContext}
hotkeysScope={InternalHotkeysScope.TableHeaderDropdownButton}
HotkeyScope={FiltersHotkeyScope.FilterDropdownButton}
/>
<SortDropdownButton<SortField>
isSortSelected={sorts.length > 0}
availableSorts={availableSorts || []}
onSortSelect={sortSelect}
hotkeysScope={InternalHotkeysScope.TableHeaderDropdownButton}
HotkeyScope={FiltersHotkeyScope.FilterDropdownButton}
/>
</StyledFilters>
</StyledTableHeader>