mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +03:00
[WIP] Change map with MenuItem to PaginatedList
This commit is contained in:
1 parent
0a0946cf12
commit
b6813272c1
1 file changed
+29
-20
@@ -5,6 +5,9 @@ import Button, { Inner } from "~/components/Button";
|
||||
import ContextMenu from "~/components/ContextMenu";
|
||||
import MenuItem from "~/components/ContextMenu/MenuItem";
|
||||
import Text from "~/components/Text";
|
||||
import { Outline } from "./Input";
|
||||
import InputSearch from "./InputSearch";
|
||||
import PaginatedList, { PaginatedItem } from "./PaginatedList";
|
||||
|
||||
type TFilterOption = {
|
||||
key: string;
|
||||
@@ -47,26 +50,32 @@ const FilterOptions = ({
|
||||
)}
|
||||
</MenuButton>
|
||||
<ContextMenu aria-label={defaultLabel} {...menu}>
|
||||
{options.map((option) => (
|
||||
<MenuItem
|
||||
key={option.key}
|
||||
onClick={() => {
|
||||
onSelect(option.key);
|
||||
menu.hide();
|
||||
}}
|
||||
selected={option.key === activeKey}
|
||||
{...menu}
|
||||
>
|
||||
{option.note ? (
|
||||
<LabelWithNote>
|
||||
{option.label}
|
||||
<Note>{option.note}</Note>
|
||||
</LabelWithNote>
|
||||
) : (
|
||||
option.label
|
||||
)}
|
||||
</MenuItem>
|
||||
))}
|
||||
{searchable && <StyledInputSearch onChange={handleFilter} />}
|
||||
{searchable && <br />}
|
||||
<PaginatedList
|
||||
items={filteredData}
|
||||
fetch={paginateFetch}
|
||||
renderItem={(option: TFilterOption) => (
|
||||
<MenuItem
|
||||
key={option.key}
|
||||
onClick={() => {
|
||||
onSelect(option.key);
|
||||
menu.hide();
|
||||
}}
|
||||
selected={option.key === activeKey}
|
||||
{...menu}
|
||||
>
|
||||
{option.note ? (
|
||||
<LabelWithNote>
|
||||
{option.label}
|
||||
<Note>{option.note}</Note>
|
||||
</LabelWithNote>
|
||||
) : (
|
||||
option.label
|
||||
)}
|
||||
</MenuItem>
|
||||
)}
|
||||
/>
|
||||
</ContextMenu>
|
||||
</Wrapper>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user