Skip to content

Commit

Permalink
Refactor #4391 - For ContextMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
ulasturann committed May 17, 2023
1 parent f824363 commit 4e6cb7e
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions components/doc/contextmenu/pt/ptdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export function PTDoc(props) {
ref={cm}
breakpoint="767px"
pt={{
action: ({ props, state, context }) => ({ className: context.active ? 'bg-primary-200' : context.focused ? 'bg-primary-300' : undefined })
action: ({ props, state, context }) => ({ className: context.active ? 'bg-primary-200' : undefined })
}}
/>
<img src="/images/nature/nature3.jpg" alt="Logo" className="max-w-full" onContextMenu={(e) => cm.current.show(e)} />
Expand Down Expand Up @@ -279,7 +279,14 @@ export default function PTDemo() {
return (
<div className="card flex md:justify-content-center">
<ContextMenu model={items} ref={cm} breakpoint="767px" />
<ContextMenu
model={items}
ref={cm}
breakpoint="767px"
pt={{
action: ({ props, state, context }) => ({ className: context.active ? 'bg-primary-200' : undefined })
}}
/>
<img src="https://primefaces.org/cdn/primereact/images/nature/nature3.jpg" alt="Logo" className="max-w-full" onContextMenu={(e) => cm.current.show(e)} />
</div>
)
Expand Down Expand Up @@ -421,7 +428,14 @@ export default function PTDemo() {
return (
<div className="card flex md:justify-content-center">
<ContextMenu model={items} ref={cm} breakpoint="767px" />
<ContextMenu
model={items}
ref={cm}
breakpoint="767px"
pt={{
action: ({ props, state, context }) => ({ className: context.active ? 'bg-primary-200' : undefined })
}}
/>
<img src="https://primefaces.org/cdn/primereact/images/nature/nature3.jpg" alt="Logo" className="max-w-full" onContextMenu={(e) => cm.current.show(e)} />
</div>
)
Expand All @@ -442,7 +456,7 @@ export default function PTDemo() {
ref={cm}
breakpoint="767px"
pt={{
action: ({ props, state, context }) => ({ className: context.active ? 'bg-primary-200' : context.focused ? 'bg-primary-300' : undefined })
action: ({ props, state, context }) => ({ className: context.active ? 'bg-primary-200' : undefined })
}}
/>
<img src="https://primefaces.org/cdn/primereact/images/nature/nature3.jpg" alt="Logo" className="max-w-full" onContextMenu={(e) => cm.current.show(e)} />
Expand Down

0 comments on commit 4e6cb7e

Please sign in to comment.