diff --git a/assets/apps/dashboard/src/Components/Content/FreePro.js b/assets/apps/dashboard/src/Components/Content/FreePro.js index 33c7226692..e664e548a8 100644 --- a/assets/apps/dashboard/src/Components/Content/FreePro.js +++ b/assets/apps/dashboard/src/Components/Content/FreePro.js @@ -2,17 +2,10 @@ import { __ } from '@wordpress/i18n'; -import { - CheckCircle2, - XCircle, - HelpCircle, - ArrowRight, - BookOpen, -} from 'lucide-react'; +import { CheckCircle2, XCircle, HelpCircle } from 'lucide-react'; import Card from '../../Layout/Card'; import Tooltip from '../Common/Tooltip'; -import Button from '../Common/Button'; import TransitionWrapper from '../Common/TransitionWrapper'; const FreeProCard = () => ( @@ -80,63 +73,12 @@ const FreeProCard = () => ( ); -const UpsellCard = () => { - return ( - -
-

- {__('Need help deciding?', 'neve')} -

-
-

- {__( - 'Our support team is happy to answer your questions about specific Pro features and help you determine if they match your needs.', - 'neve' - )} -

-
-
- {__( - 'Average response time: ~8 hours during business days', - 'neve' - )} -
-
-
-
- - -
-
-
- ); -}; - export default () => { return (
- - -
); }; diff --git a/assets/apps/dashboard/src/Components/Content/ModuleGrid.js b/assets/apps/dashboard/src/Components/Content/ModuleGrid.js index 9dd00a7a9f..2902ea6bb3 100644 --- a/assets/apps/dashboard/src/Components/Content/ModuleGrid.js +++ b/assets/apps/dashboard/src/Components/Content/ModuleGrid.js @@ -2,7 +2,12 @@ import { useDispatch, useSelect } from '@wordpress/data'; import { useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; -import { LoaderCircle, LucideCheck, LucideSettings } from 'lucide-react'; +import { + LoaderCircle, + LucideCheck, + LucideSettings, + LucideExternalLink, +} from 'lucide-react'; import useLicenseData from '../../Hooks/useLicenseData'; import Card from '../../Layout/Card'; @@ -137,12 +142,14 @@ const ModulesHeader = () => { : __('Neve Pro Modules', 'neve')} {!isLicenseValid && ( - + )} ); diff --git a/assets/apps/dashboard/src/Components/Content/Settings/GeneralTabContent.js b/assets/apps/dashboard/src/Components/Content/Settings/GeneralTabContent.js index 4a1c828892..75f9e67fd8 100644 --- a/assets/apps/dashboard/src/Components/Content/Settings/GeneralTabContent.js +++ b/assets/apps/dashboard/src/Components/Content/Settings/GeneralTabContent.js @@ -7,6 +7,7 @@ import { LucideMonitorDown, LucideTags, LucideType, + LucideExternalLink, } from 'lucide-react'; import useLicenseData from '../../../Hooks/useLicenseData'; import { NEVE_HAS_VALID_PRO } from '../../../utils/constants'; @@ -16,6 +17,7 @@ import OptionGroup from './OptionGroup'; import ControlWrap from '../../Controls/ControlWrap'; import Toggle from '../../Common/Toggle'; import Select from '../../Common/Select'; +import Button from '../../Common/Button'; const DUMMY_SETTINGS_ARGS = { enable_featured_image_taxonomy: { @@ -185,9 +187,22 @@ export default () => { return ( <> -

- {__('General Settings', 'neve')} -

+
+

+ {__('General Settings', 'neve')} +

+ + {!isLicenseValid && ( + + )} +
{(isLicenseValid && ) || } diff --git a/assets/apps/dashboard/src/Components/Content/Settings/PerformanceTabContent.js b/assets/apps/dashboard/src/Components/Content/Settings/PerformanceTabContent.js index 536e468d8a..1efe58f04e 100644 --- a/assets/apps/dashboard/src/Components/Content/Settings/PerformanceTabContent.js +++ b/assets/apps/dashboard/src/Components/Content/Settings/PerformanceTabContent.js @@ -1,7 +1,14 @@ /* global neveDash */ import { __ } from '@wordpress/i18n'; -import { LucideCode, LucideSmile, LucideText, LucideZap } from 'lucide-react'; +import { + LucideCode, + LucideSmile, + LucideText, + LucideZap, + LucideExternalLink, +} from 'lucide-react'; import ToggleControl from '../../Controls/ToggleControl'; +import Button from '../../Common/Button'; import useLicenseData from '../../../Hooks/useLicenseData'; import OptionGroup from './OptionGroup'; @@ -78,9 +85,22 @@ export default () => { return ( <> -

- {__('Performance Settings', 'neve')} -

+
+

+ {__('Performance Settings', 'neve')} +

+ + {!isLicenseValid && ( + + )} +
( @@ -107,6 +109,54 @@ const ContributingCard = () => { ); }; +const UpsellCard = () => { + return ( + +
+

+ {__('Need help deciding?', 'neve')} +

+
+

+ {__( + 'Our support team is happy to answer your questions about specific Pro features and help you determine if they match your needs.', + 'neve' + )} +

+
+
+ {__( + 'Average response time: ~8 hours during business days', + 'neve' + )} +
+
+
+
+ + +
+
+
+ ); +}; + const CommunityCard = () => { return ( @@ -127,12 +177,21 @@ const CommunityCard = () => { }; const Sidebar = () => { + const { currentTab } = useSelect((select) => { + const { getTab } = select(NEVE_STORE); + return { + currentTab: getTab(), + }; + }); + return (
{NEVE_HAS_PRO && } {NEVE_HAS_PRO && } + {currentTab === 'free-pro' && } + {!NEVE_IS_WHITELABEL && } {!NEVE_HAS_PRO && } diff --git a/assets/apps/dashboard/src/Components/Header.js b/assets/apps/dashboard/src/Components/Header.js index d39bfd3ec2..ca7818cae6 100644 --- a/assets/apps/dashboard/src/Components/Header.js +++ b/assets/apps/dashboard/src/Components/Header.js @@ -6,7 +6,11 @@ import { Fragment, useEffect } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { useDispatch, useSelect } from '@wordpress/data'; -import { LucideBookOpen, LucideFileText } from 'lucide-react'; +import { + LucideBookOpen, + LucideFileText, + LucideExternalLink, +} from 'lucide-react'; import useLicenseData from '../Hooks/useLicenseData'; import Container from '../Layout/Container'; import { NEVE_IS_WHITELABEL, NEVE_STORE } from '../utils/constants'; @@ -107,6 +111,8 @@ const HeaderTopBar = ({ currentTab, setTab }) => { }; const Navigation = ({ setTab, currentTab }) => { + const { isLicenseValid } = useLicenseData(); + return (
@@ -115,13 +121,22 @@ const Navigation = ({ setTab, currentTab }) => { if (!label) { return null; } + // Hide "Get Neve Pro" tab for users with valid licenses + if (slug === 'get-neve-pro' && isLicenseValid) { + return null; + } const itemClasses = cn([ 'relative px-4 py-3 font-medium border-b-2', { 'text-blue-600 border-blue-600': - currentTab === slug, + currentTab === slug && + slug !== 'get-neve-pro', 'border-transparent text-gray-600 hover:text-gray-900 transition-colors duration-150': - currentTab !== slug, + currentTab !== slug && + slug !== 'get-neve-pro', + 'border-transparent text-blue-600 transition-colors duration-150': + currentTab !== slug && + slug === 'get-neve-pro', }, ]); @@ -136,6 +151,9 @@ const Navigation = ({ setTab, currentTab }) => { if (!url) { linkProps.onClick = handleLinkClick; + } else { + linkProps.target = '_blank'; + linkProps.rel = 'noopener noreferrer'; } return ( @@ -144,7 +162,15 @@ const Navigation = ({ setTab, currentTab }) => { key={slug} className={itemClasses} > - {label} + + {label} + {url && ( + + )} + ); })} diff --git a/assets/apps/dashboard/src/utils/common.js b/assets/apps/dashboard/src/utils/common.js index a145c5e438..f55d146078 100644 --- a/assets/apps/dashboard/src/utils/common.js +++ b/assets/apps/dashboard/src/utils/common.js @@ -29,6 +29,11 @@ const tabs = { changelog: { render: () => , }, + 'get-neve-pro': { + label: __('Get Neve Pro', 'neve'), + url: neveDash.upgradeURLModules, + external: true, + }, }; const { plugins } = neveDash; @@ -68,7 +73,7 @@ const getTabHash = () => { hash = hash.substring(1); - if (!tabs[hash]?.render) { + if (!tabs[hash]?.render && !tabs[hash]?.url) { return null; }