remove deprecated component use (#28924)
towards: #28197 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
071032a108
commit
9a418cc53d
1 changed files with 25 additions and 16 deletions
|
@ -6,17 +6,16 @@ import {
|
||||||
DataListItem,
|
DataListItem,
|
||||||
DataListItemCells,
|
DataListItemCells,
|
||||||
DataListItemRow,
|
DataListItemRow,
|
||||||
|
Dropdown,
|
||||||
|
DropdownItem,
|
||||||
|
MenuToggle,
|
||||||
PageSection,
|
PageSection,
|
||||||
Spinner,
|
Spinner,
|
||||||
Split,
|
Split,
|
||||||
SplitItem,
|
SplitItem,
|
||||||
Title,
|
Title,
|
||||||
} from "@patternfly/react-core";
|
} from "@patternfly/react-core";
|
||||||
import {
|
import { EllipsisVIcon } from "@patternfly/react-icons";
|
||||||
Dropdown,
|
|
||||||
DropdownItem,
|
|
||||||
KebabToggle,
|
|
||||||
} from "@patternfly/react-core/deprecated";
|
|
||||||
import { CSSProperties, useState } from "react";
|
import { CSSProperties, useState } from "react";
|
||||||
import { Trans, useTranslation } from "react-i18next";
|
import { Trans, useTranslation } from "react-i18next";
|
||||||
import { getCredentials } from "../api/methods";
|
import { getCredentials } from "../api/methods";
|
||||||
|
@ -27,9 +26,9 @@ import {
|
||||||
import { EmptyRow } from "../components/datalist/EmptyRow";
|
import { EmptyRow } from "../components/datalist/EmptyRow";
|
||||||
import { Page } from "../components/page/Page";
|
import { Page } from "../components/page/Page";
|
||||||
import { TFuncKey } from "../i18n";
|
import { TFuncKey } from "../i18n";
|
||||||
|
import { useEnvironment } from "../root/KeycloakContext";
|
||||||
import { formatDate } from "../utils/formatDate";
|
import { formatDate } from "../utils/formatDate";
|
||||||
import { usePromise } from "../utils/usePromise";
|
import { usePromise } from "../utils/usePromise";
|
||||||
import { useEnvironment } from "../root/KeycloakContext";
|
|
||||||
|
|
||||||
type MobileLinkProps = {
|
type MobileLinkProps = {
|
||||||
title: string;
|
title: string;
|
||||||
|
@ -42,17 +41,27 @@ const MobileLink = ({ title, onClick, testid }: MobileLinkProps) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
isPlain
|
popperProps={{
|
||||||
position="right"
|
position: "right",
|
||||||
toggle={<KebabToggle onToggle={(_event, val) => setOpen(val)} />}
|
}}
|
||||||
|
onOpenChange={(isOpen) => setOpen(isOpen)}
|
||||||
|
toggle={(toggleRef) => (
|
||||||
|
<MenuToggle
|
||||||
className="pf-v5-u-display-none-on-lg"
|
className="pf-v5-u-display-none-on-lg"
|
||||||
|
ref={toggleRef}
|
||||||
|
variant="plain"
|
||||||
|
onClick={() => setOpen(!open)}
|
||||||
|
isExpanded={open}
|
||||||
|
>
|
||||||
|
<EllipsisVIcon />
|
||||||
|
</MenuToggle>
|
||||||
|
)}
|
||||||
isOpen={open}
|
isOpen={open}
|
||||||
dropdownItems={[
|
>
|
||||||
<DropdownItem key="1" onClick={onClick}>
|
<DropdownItem key="1" onClick={onClick}>
|
||||||
{title}
|
{title}
|
||||||
</DropdownItem>,
|
</DropdownItem>
|
||||||
]}
|
</Dropdown>
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
variant="link"
|
variant="link"
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
|
|
Loading…
Reference in a new issue