import React from 'react'; import { Brand, Breadcrumb, BreadcrumbItem, Button, Drawer, DrawerActions, DrawerCloseButton, DrawerContent, DrawerPanelContent, DrawerHead, Flex, Nav, NavItem, NavList, Page, PageSection, PageSectionTypes, PageSectionVariants, PageSidebar, PageSidebarBody, SkipToContent, Text, TextContent, Masthead, PageToggleButton, MastheadToggle, MastheadMain, MastheadBrand, Wizard, WizardStep, DrawerColorVariant } from '@patternfly/react-core'; import pfLogo from '@patternfly/react-core/src/demos/assets/pf-logo.svg'; import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon'; export const WizardFullPageWithDrawerDemo: React.FunctionComponent = () => { const [isDrawerExpanded, setIsDrawerExpanded] = React.useState(false); const [activeItem, setActiveItem] = React.useState(0); const drawerRef = React.useRef(null); const onExpand = () => { if (drawerRef.current) { drawerRef.current.focus(); } }; const onOpenClick = () => { setIsDrawerExpanded(true); }; const onCloseClick = () => { setIsDrawerExpanded(false); }; const onNavSelect = (_event: React.FormEvent, result: { itemId: number | string }) => { setActiveItem(result.itemId as number); }; const PageNav = ( ); const Header = ( ); const Sidebar = ( {PageNav} ); const pageId = 'main-content-page-layout-default-nav'; const PageSkipToContent = Skip to content; const PageBreadcrumb = ( Section home Section title Section title Section landing ); const createStepContentWithDrawer = (stepName: string) => ( Drawer content: {stepName} } > {!isDrawerExpanded && ( )}
{stepName} content
); return ( Main title A demo of a wizard in a page. {createStepContentWithDrawer('Information step')} {createStepContentWithDrawer('Configuration substep A')} , {createStepContentWithDrawer('Configuration substep B')} ]} /> {createStepContentWithDrawer('Additional step')} {createStepContentWithDrawer('Review step')} ); };