Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/react-core/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export * from './Accordion';
export * from './ActionList';
export * from './Alert';
export * from './AlertGroup';
export * from './ApplicationLauncher';
export * from './Avatar';
export * from './BackToTop';
export * from './Backdrop';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const ComposableApplicationLauncher: React.FunctionComponent = () => {
'li > button:not(:disabled), li > a:not(:disabled), input:not(:disabled)'
);
firstElement && (firstElement as HTMLElement).focus();
setRefFullOptions(Array.from(menuRef.current.querySelectorAll('li:not(li[role=separator])')));
setRefFullOptions(Array.from(menuRef.current.querySelectorAll('li:not(li[role=separator])>*:first-child')));
}
}, 0);
setIsOpen(!isOpen);
Expand Down
3 changes: 3 additions & 0 deletions packages/react-core/src/demos/Masthead.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
import imgAvatar from '@patternfly/react-core/src/components/Avatar/examples/avatarImg.svg';
import {
Expand All @@ -16,6 +17,8 @@ DropdownItem as DropdownItemDeprecated,
DropdownToggle,
KebabToggle
} from '@patternfly/react-core/deprecated';
import pfIcon from './Card/pf-logo-small.svg';
import { Link } from '@reach/router';

## Demos

Expand Down
37 changes: 2 additions & 35 deletions packages/react-core/src/demos/examples/DashboardHeader.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';
import {
ApplicationLauncher,
ApplicationLauncherItem,
Avatar,
Brand,
Button,
Expand All @@ -16,7 +14,7 @@ import {
ToolbarContent,
ToolbarGroup,
ToolbarItem,
PageToggleButton
PageToggleButton,
} from '@patternfly/react-core';
import {
Dropdown as DropdownDeprecated,
Expand All @@ -40,7 +38,6 @@ export default class DashboardHeader extends React.Component {
isDropdownOpen: false,
isKebabDropdownOpen: false,
isFullKebabDropdownOpen: false,
isAppLauncherOpen: false,
activeItem: 0
};

Expand Down Expand Up @@ -79,22 +76,10 @@ export default class DashboardHeader extends React.Component {
isFullKebabDropdownOpen: !this.state.isFullKebabDropdownOpen
});
};

this.onAppLauncherToggle = (_event, isAppLauncherOpen) => {
this.setState({
isAppLauncherOpen
});
};

this.onAppLauncherSelect = () => {
this.setState({
isAppLauncherOpen: !this.state.isAppLauncherOpen
});
};
}

render() {
const { isDropdownOpen, isKebabDropdownOpen, isFullKebabDropdownOpen, isAppLauncherOpen } = this.state;
const { isDropdownOpen, isKebabDropdownOpen, isFullKebabDropdownOpen } = this.state;
const { notificationBadge } = this.props;

const kebabDropdownItems = [
Expand Down Expand Up @@ -133,15 +118,6 @@ export default class DashboardHeader extends React.Component {
</DropdownGroupDeprecated>
];

const appLauncherItems = [
<ApplicationLauncherItem key="application_1a" href="#">
Application 1 (anchor link)
</ApplicationLauncherItem>,
<ApplicationLauncherItem key="application_2a" component="button" onClick={() => alert('Clicked item 2')}>
Application 2 (button with onClick)
</ApplicationLauncherItem>
];

const headerToolbar = (
<Toolbar id="toolbar" isFullHeight isStatic>
<ToolbarContent>
Expand All @@ -163,15 +139,6 @@ export default class DashboardHeader extends React.Component {
</ToolbarItem>
)}
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}>
<ToolbarItem>
<ApplicationLauncher
onSelect={this.onAppLauncherSelect}
onToggle={this.onAppLauncherToggle}
isOpen={isAppLauncherOpen}
items={appLauncherItems}
toggleId="dashboard-header-app-launcher"
/>
</ToolbarItem>
<ToolbarItem>
<Button aria-label="Settings" variant={ButtonVariant.plain} icon={<CogIcon />} />
</ToolbarItem>
Expand Down
Loading