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
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,11 @@ exports[`ApplicationLauncher custom icon 1`] = `
</button>
</li>
<li
role="none"
role="separator"
>
<hr
class="pf-c-divider pf-c-app-launcher__menu-item"
<div
class="pf-c-divider"
role="separator"
/>
</li>
<li
Expand Down Expand Up @@ -353,10 +354,11 @@ exports[`ApplicationLauncher custom icon 1`] = `
</button>
</li>
<li
role="none"
role="separator"
>
<hr
class="pf-c-divider pf-c-app-launcher__menu-item"
<div
class="pf-c-divider"
role="separator"
/>
</li>
<li
Expand Down Expand Up @@ -472,6 +474,7 @@ exports[`ApplicationLauncher custom icon 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={0}
isDisabled={false}
isHovered={false}
Expand All @@ -482,7 +485,6 @@ exports[`ApplicationLauncher custom icon 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -529,6 +531,7 @@ exports[`ApplicationLauncher custom icon 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={1}
isDisabled={false}
isHovered={false}
Expand All @@ -539,7 +542,6 @@ exports[`ApplicationLauncher custom icon 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -588,6 +590,7 @@ exports[`ApplicationLauncher custom icon 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={2}
isDisabled={true}
isHovered={false}
Expand All @@ -598,7 +601,6 @@ exports[`ApplicationLauncher custom icon 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -647,6 +649,7 @@ exports[`ApplicationLauncher custom icon 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={3}
isDisabled={true}
isHovered={false}
Expand All @@ -657,7 +660,6 @@ exports[`ApplicationLauncher custom icon 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -689,34 +691,40 @@ exports[`ApplicationLauncher custom icon 1`] = `
>
<InternalDropdownItem
className=""
component={[Function]}
component={
<Divider
component="div"
/>
}
context={
Object {
"keyHandler": [Function],
"sendRef": [Function],
}
}
enterTriggersArrowDown={false}
icon={null}
index={4}
isDisabled={false}
isHovered={false}
isPlainText={false}
onClick={[Function]}
role="none"
role="separator"
tooltipProps={Object {}}
variant="item"
>
<li
className={null}
onClick={[Function]}
onKeyDown={[Function]}
role="none"
role="separator"
>
<Divider
className="pf-c-app-launcher__menu-item"
className=""
component="div"
>
<hr
className="pf-c-divider pf-c-app-launcher__menu-item"
<div
className="pf-c-divider"
role="separator"
/>
</Divider>
</li>
Expand Down Expand Up @@ -747,6 +755,7 @@ exports[`ApplicationLauncher custom icon 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={5}
isDisabled={false}
isHovered={false}
Expand All @@ -757,7 +766,6 @@ exports[`ApplicationLauncher custom icon 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -804,6 +812,7 @@ exports[`ApplicationLauncher custom icon 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={6}
isDisabled={false}
isHovered={false}
Expand All @@ -814,7 +823,6 @@ exports[`ApplicationLauncher custom icon 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -1600,10 +1608,11 @@ exports[`ApplicationLauncher expanded 1`] = `
</button>
</li>
<li
role="none"
role="separator"
>
<hr
class="pf-c-divider pf-c-app-launcher__menu-item"
<div
class="pf-c-divider"
role="separator"
/>
</li>
<li
Expand Down Expand Up @@ -1733,10 +1742,11 @@ exports[`ApplicationLauncher expanded 1`] = `
</button>
</li>
<li
role="none"
role="separator"
>
<hr
class="pf-c-divider pf-c-app-launcher__menu-item"
<div
class="pf-c-divider"
role="separator"
/>
</li>
<li
Expand Down Expand Up @@ -1850,6 +1860,7 @@ exports[`ApplicationLauncher expanded 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={0}
isDisabled={false}
isHovered={false}
Expand All @@ -1860,7 +1871,6 @@ exports[`ApplicationLauncher expanded 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -1907,6 +1917,7 @@ exports[`ApplicationLauncher expanded 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={1}
isDisabled={false}
isHovered={false}
Expand All @@ -1917,7 +1928,6 @@ exports[`ApplicationLauncher expanded 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -1966,6 +1976,7 @@ exports[`ApplicationLauncher expanded 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={2}
isDisabled={true}
isHovered={false}
Expand All @@ -1976,7 +1987,6 @@ exports[`ApplicationLauncher expanded 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -2025,6 +2035,7 @@ exports[`ApplicationLauncher expanded 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={3}
isDisabled={true}
isHovered={false}
Expand All @@ -2035,7 +2046,6 @@ exports[`ApplicationLauncher expanded 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -2067,34 +2077,40 @@ exports[`ApplicationLauncher expanded 1`] = `
>
<InternalDropdownItem
className=""
component={[Function]}
component={
<Divider
component="div"
/>
}
context={
Object {
"keyHandler": [Function],
"sendRef": [Function],
}
}
enterTriggersArrowDown={false}
icon={null}
index={4}
isDisabled={false}
isHovered={false}
isPlainText={false}
onClick={[Function]}
role="none"
role="separator"
tooltipProps={Object {}}
variant="item"
>
<li
className={null}
onClick={[Function]}
onKeyDown={[Function]}
role="none"
role="separator"
>
<Divider
className="pf-c-app-launcher__menu-item"
className=""
component="div"
>
<hr
className="pf-c-divider pf-c-app-launcher__menu-item"
<div
className="pf-c-divider"
role="separator"
/>
</Divider>
</li>
Expand Down Expand Up @@ -2125,6 +2141,7 @@ exports[`ApplicationLauncher expanded 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={5}
isDisabled={false}
isHovered={false}
Expand All @@ -2135,7 +2152,6 @@ exports[`ApplicationLauncher expanded 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down Expand Up @@ -2182,6 +2198,7 @@ exports[`ApplicationLauncher expanded 1`] = `
}
enterTriggersArrowDown={false}
href={null}
icon={null}
index={6}
isDisabled={false}
isHovered={false}
Expand All @@ -2192,7 +2209,6 @@ exports[`ApplicationLauncher expanded 1`] = `
tabIndex={-1}
tooltip={null}
tooltipProps={null}
variant="item"
>
<li
className={null}
Expand Down
8 changes: 4 additions & 4 deletions packages/react-core/src/components/Dropdown/DropdownItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export interface DropdownItemProps extends InternalDropdownItemProps {
* Example: component="button"
*/
component?: React.ReactNode;
/** Variant of the item. The 'icon' variant should use DropdownItemIcon to wrap contained icons or images. */
variant?: 'item' | 'icon';
/** Render dropdown item as disabled option */
isDisabled?: boolean;
/** Render dropdown item as non-interactive item */
Expand All @@ -32,13 +30,14 @@ export interface DropdownItemProps extends InternalDropdownItemProps {
additionalChild?: React.ReactNode;
/** Custom item rendering that receives the DropdownContext */
customChild?: React.ReactNode;
/** An image to display within the DropdownItem, appearing before any component children */
icon?: React.ReactNode;
}

export const DropdownItem: React.FunctionComponent<DropdownItemProps> = ({
children = null,
className = '',
component = 'a',
variant = 'item',
isDisabled = false,
isPlainText = false,
isHovered = false,
Expand All @@ -51,6 +50,7 @@ export const DropdownItem: React.FunctionComponent<DropdownItemProps> = ({
ref, // Types of Ref are different for React.FC vs React.Component
additionalChild,
customChild,
icon = null,
...props
}: DropdownItemProps) => (
<DropdownArrowContext.Consumer>
Expand All @@ -61,7 +61,6 @@ export const DropdownItem: React.FunctionComponent<DropdownItemProps> = ({
tabIndex={-1}
className={className}
component={component}
variant={variant}
isDisabled={isDisabled}
isPlainText={isPlainText}
isHovered={isHovered}
Expand All @@ -72,6 +71,7 @@ export const DropdownItem: React.FunctionComponent<DropdownItemProps> = ({
onClick={onClick}
additionalChild={additionalChild}
customChild={customChild}
icon={icon}
{...props}
>
{children}
Expand Down
Loading