Skip to content

Commit

Permalink
Apply Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ulasturann committed May 17, 2023
1 parent 05b5074 commit 41bb9af
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 41 deletions.
2 changes: 0 additions & 2 deletions components/doc/menu/pt/wireframe.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

import React from 'react';
import { DocSectionText } from '../../common/docsectiontext';

export const Wireframe = (props) => {

return (
<>
<DocSectionText {...props} />
Expand Down
34 changes: 13 additions & 21 deletions components/lib/menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,14 @@ export const Menu = React.memo(
{
className,
style: submenu.style,
role: "presentation"
role: 'presentation'
},
ptm('submenuHeader')
);

return (
<React.Fragment key={key}>
<li {...submenuHeaderProps}>
{submenu.label}
</li>
<li {...submenuHeaderProps}>{submenu.label}</li>
{items}
</React.Fragment>
);
Expand All @@ -181,11 +179,11 @@ export const Menu = React.memo(
const separatorProps = mergeProps(
{
key,
className: "p-menu-separator",
role: "separator"
className: 'p-menu-separator',
role: 'separator'
},
ptm('separator')
)
);

return <li {...separatorProps}></li>;
};
Expand All @@ -207,7 +205,7 @@ export const Menu = React.memo(
const icon = IconUtils.getJSXIcon(item.icon, { ...iconProps }, { props });
const labelProps = mergeProps(
{
className: "p-menuitem-text"
className: 'p-menuitem-text'
},
ptm('label')
);
Expand All @@ -218,12 +216,12 @@ export const Menu = React.memo(
{
href: item.url || '#',
className: linkClassName,
role: "menuitem",
role: 'menuitem',
target: item.target,
onClick: (event) => onItemClick(event, item),
onKeyDown: (event) => onItemKeyDown(event, item),
tabIndex: tabIndex,
'aria-disabled': item.disabled,
'aria-disabled': item.disabled
},
ptm('action')
);
Expand Down Expand Up @@ -255,16 +253,12 @@ export const Menu = React.memo(
key,
className,
style: item.style,
role: "none"
role: 'none'
},
ptm('menuitem')
);

return (
<li {...menuitemProps}>
{content}
</li>
);
return <li {...menuitemProps}>{content}</li>;
};

const createItem = (item, index) => {
Expand Down Expand Up @@ -301,8 +295,8 @@ export const Menu = React.memo(

const menuProps = mergeProps(
{
className: "p-menu-list p-reset",
role: "menu"
className: 'p-menu-list p-reset',
role: 'menu'
},
ptm('menu')
);
Expand All @@ -321,9 +315,7 @@ export const Menu = React.memo(
onExited={onExited}
>
<div {...rootProps}>
<ul {...menuProps}>
{menuitems}
</ul>
<ul {...menuProps}>{menuitems}</ul>
</div>
</CSSTransition>
);
Expand Down
35 changes: 17 additions & 18 deletions pages/menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,23 @@ const MenuDemo = () => {
component: AccessibilityDoc
}
];
const ptDocs = [
{
id: 'pt.wireframe',
label: 'Wireframe',
component: Wireframe
},
{
id: 'pt.menu.options',
label: 'Menu PT Options',
component: DocApiTable
},
{
id: 'pt.demo',
label: 'Example',
component: PTDoc
}
];

const ptDocs = [
{
id: 'pt.wireframe',
label: 'Wireframe',
component: Wireframe
},
{
id: 'pt.menu.options',
label: 'Menu PT Options',
component: DocApiTable
},
{
id: 'pt.demo',
label: 'Example',
component: PTDoc
}
];

return <DocComponent title="React Menu Component" header="Menu" description="Menu is a navigation/command component that supports dynamic and static positioning." componentDocs={docs} apiDocs={['Menu', 'MenuItem']} ptDocs={ptDocs} />;
};
Expand Down

0 comments on commit 41bb9af

Please sign in to comment.