Skip to content

Commit

Permalink
refactor: improve multiselect behaviours
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Dec 9, 2024
1 parent 938a85d commit 0f50e28
Show file tree
Hide file tree
Showing 3 changed files with 662 additions and 416 deletions.
12 changes: 6 additions & 6 deletions libs/design-system/src/multi/MultiSelectionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { Panel } from '../core/Panel'
import { Text } from '../core/Text'
import { pluralize } from '@siafoundation/units'
import { Close16 } from '@siafoundation/react-icons'
import { MultiSelect, MultiSelectItem } from './useMultiSelect'
import { MultiSelect, MultiSelectRow } from './useMultiSelect'
import { AppDockedControl } from '../app/AppDockedControl'

export function MultiSelectionMenu<Item extends MultiSelectItem>({
export function MultiSelectionMenu<Row extends MultiSelectRow>({
multiSelect,
children,
entityWord,
entityWordPlural,
}: {
multiSelect: MultiSelect<Item>
multiSelect: MultiSelect<Row>
children: React.ReactNode
entityWord: string
entityWordPlural?: string
Expand All @@ -36,13 +36,13 @@ export function MultiSelectionMenu<Item extends MultiSelectItem>({
{`${pluralize(multiSelect.selectionCount, entityWord, {
plural: entityWordPlural,
})} selected${
multiSelect.someSelectedItemsOutsideCurrentPage &&
multiSelect.someSelectedRowsOutsideCurrentPage &&
multiSelect.someSelectedOnCurrentPage
? ' on this and other pages'
: !multiSelect.someSelectedItemsOutsideCurrentPage &&
: !multiSelect.someSelectedRowsOutsideCurrentPage &&
multiSelect.someSelectedOnCurrentPage
? ''
: multiSelect.someSelectedItemsOutsideCurrentPage &&
: multiSelect.someSelectedRowsOutsideCurrentPage &&
!multiSelect.someSelectedOnCurrentPage
? ' on other pages'
: ''
Expand Down
Loading

0 comments on commit 0f50e28

Please sign in to comment.