remove deprecated component use (#28924)

towards: #28197

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-04-22 07:21:58 +02:00 committed by GitHub
parent 071032a108
commit 9a418cc53d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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}