Skip to content
Merged
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
30 changes: 20 additions & 10 deletions src/components/ProPreviews/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ wp.hooks.addFilter(
// Check if Pro is loaded dynamically
const isProLoaded = wp.hooks.applyFilters('wedocs_pro_loaded', false);
if (isProLoaded) return templates;

const assistantWidgetSubPanels = [
<AiChatBotSettings key={ index } />,
<ExploreSettings key={ index } />,
Expand Down Expand Up @@ -215,7 +215,7 @@ wp.hooks.addFilter(
// Check if Pro is loaded dynamically
const isProLoaded = wp.hooks.applyFilters('wedocs_pro_loaded', false);
if (isProLoaded) return componentsArray;

return (
<>
{ userIsAdmin() && (
Expand All @@ -229,13 +229,23 @@ wp.hooks.addFilter(
</UpgradePopup>
) }
{ type === 'article' && (

<UpgradePopup>
<span className='group w-full flex items-center py-2 px-4 space-x-2.5 text-sm font-medium text-gray-700 hover:bg-indigo-700 hover:text-white !shadow-none'>
<span>{ __( 'Restrict editing for admin only', 'wedocs' ) }</span>
<Badge classes="opacity-0 group-hover:opacity-100 transition-opacity"/>
</span>
</UpgradePopup>

<>
<UpgradePopup>
<span
className="group w-full flex items-center py-2 px-4 space-x-2.5 text-sm font-medium text-gray-700 hover:bg-indigo-700 hover:text-white !shadow-none">
<span>{__( 'Duplicate', 'wedocs' )}</span>
<Badge classes="opacity-0 group-hover:opacity-100 transition-opacity"/>
</span>
</UpgradePopup>
<UpgradePopup>
<span
className="group w-full flex items-center py-2 px-4 space-x-2.5 text-sm font-medium text-gray-700 hover:bg-indigo-700 hover:text-white !shadow-none">
<span>{__( 'Restrict editing for admin only', 'wedocs' )}</span>
<Badge classes="opacity-0 group-hover:opacity-100 transition-opacity"/>
</span>
</UpgradePopup>
</>
) }
</>
) }
Expand Down Expand Up @@ -280,7 +290,7 @@ wp.hooks.addFilter(
// Check if Pro is loaded dynamically
const isProLoaded = wp.hooks.applyFilters('wedocs_pro_loaded', false);
if (isProLoaded) return menu;

// Return PRO preview menu when Pro is not loaded
return (
<UpgradePopup>
Expand Down