Skip to content

Commit

Permalink
feat(applauncher): replace input with search input
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed Nov 1, 2022
1 parent cbd415c commit 7723bd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/AppLauncher/app-launcher';
import formStyles from '@patternfly/react-styles/css/components/FormControl/form-control';
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
import { DropdownDirection, DropdownPosition, DropdownToggle, DropdownContext } from '../Dropdown';
import { DropdownWithContext } from '../Dropdown/DropdownWithContext';
Expand All @@ -10,6 +9,7 @@ import { ApplicationLauncherSeparator } from './ApplicationLauncherSeparator';
import { ApplicationLauncherItem } from './ApplicationLauncherItem';
import { ApplicationLauncherContext } from './ApplicationLauncherContext';
import { createRenderableFavorites, extendItemsWithFavorite } from '../../helpers/favorites';
import { SearchInput } from '../SearchInput';

export interface ApplicationLauncherProps extends React.HTMLProps<HTMLDivElement> {
/** Additional element css classes */
Expand Down Expand Up @@ -93,13 +93,12 @@ export class ApplicationLauncher extends React.Component<ApplicationLauncherProp
<div key="search" className={css(styles.appLauncherMenuSearch)}>
<ApplicationLauncherItem
customChild={
<input
<SearchInput
type="search"
className={css(formStyles.formControl)}
placeholder={searchPlaceholderText}
onChange={e => onSearch(e.target.value)}
onChange={value => onSearch(value)}
{...searchProps}
></input>
/>
}
></ApplicationLauncherItem>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface ApplicationLauncherItemProps {
ariaIsNotFavoriteLabel?: string;
/** ID of the item. Required for tracking favorites. */
id?: string;
/** Custom item rendering that receives the ApplicationLauncherContext */
customChild?: React.ReactNode;
/** Flag indicating if hitting enter triggers an arrow down key press. Automatically passed to favorites list items. */
enterTriggersArrowDown?: boolean;
Expand Down

0 comments on commit 7723bd6

Please sign in to comment.