From 7f11b02193dfe3e4f7c1ca54f09f90d260ae6c2c Mon Sep 17 00:00:00 2001 From: Soare Robert Daniel Date: Mon, 27 Jan 2025 15:47:28 +0200 Subject: [PATCH] feat: enhance copyright quick link with upsell description and badge (#4359) --- .../src/builder-instructions/Instructions.tsx | 27 ++++++++++++++++--- .../builder/scss/_instructional-section.scss | 21 +++++++++++++++ header-footer-grid/Core/Builder/Footer.php | 16 ++++++++--- 3 files changed, 58 insertions(+), 6 deletions(-) diff --git a/assets/apps/customizer-controls/src/builder-instructions/Instructions.tsx b/assets/apps/customizer-controls/src/builder-instructions/Instructions.tsx index d52f3524c6..063fae5a71 100644 --- a/assets/apps/customizer-controls/src/builder-instructions/Instructions.tsx +++ b/assets/apps/customizer-controls/src/builder-instructions/Instructions.tsx @@ -10,7 +10,7 @@ type Props = { const Instructions: React.FC = ({ control }) => { const { params, id } = control; const { options } = params; - const { description, quickLinks, builderMigrated, hadOldBuilder } = options; + const { description, quickLinks } = options; const linkKeys = Object.keys(quickLinks); @@ -48,8 +48,13 @@ const Instructions: React.FC = ({ control }) => {
    {linkKeys.map((settingSlug, index) => { - const { label, icon, url } = - quickLinks[settingSlug]; + const { + label, + icon, + url, + upsellDescription, + badge, + } = quickLinks[settingSlug]; return (
  • @@ -66,7 +71,23 @@ const Instructions: React.FC = ({ control }) => { > {label} + {url && badge && ( + + {badge} + + )} + {url && upsellDescription && ( +
    +

    +

    +

    +
    + )}
  • ); })} diff --git a/assets/apps/customizer-controls/src/builder/scss/_instructional-section.scss b/assets/apps/customizer-controls/src/builder/scss/_instructional-section.scss index 8585403f82..952991fb1f 100644 --- a/assets/apps/customizer-controls/src/builder/scss/_instructional-section.scss +++ b/assets/apps/customizer-controls/src/builder/scss/_instructional-section.scss @@ -14,6 +14,27 @@ button { text-decoration: none; } + + .quick-links-badge { + text-transform: uppercase; + margin-left: 6px; + color: #3965e3; + background-color: #dee8fc; + padding: 2px 6px; + border-radius: 5px; + font-weight: 600; + font-size: 12px; + } + + .quick-links-upsell { + background-color: #f9fafb; + padding: 20px 15px; + + p { + margin: 0; + color: #4d5562; + } + } } .quick-links-wrap { diff --git a/header-footer-grid/Core/Builder/Footer.php b/header-footer-grid/Core/Builder/Footer.php index d630b1759d..289f76eaad 100644 --- a/header-footer-grid/Core/Builder/Footer.php +++ b/header-footer-grid/Core/Builder/Footer.php @@ -54,6 +54,9 @@ public function init() { ) ) ); + + $upgrade_url_copyright = tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'copyright' ), 'query' ); + $this->set_property( 'instructions_array', array( @@ -65,9 +68,16 @@ public function init() { ), 'quickLinks' => array( 'footer_copyright_content' => array( - 'label' => esc_html__( 'Change Copyright', 'neve' ), - 'icon' => 'dashicons-nametag', - 'url' => $this->has_valid_addons() ? null : tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'copyright' ), 'query' ), + 'label' => esc_html__( 'Change Copyright', 'neve' ), + 'icon' => 'dashicons-nametag', + 'url' => $upgrade_url_copyright, + 'badge' => esc_html__( 'Pro', 'neve' ), + 'upsellDescription' => sprintf( + /* translators: %1$s: opening anchor tag, %2$s: closing anchor tag */ + __( 'The Neve theme free version doesn\'t support copyright edits. Pro unlocks this and more—%1$sexplore%2$s it when you\'re ready!', 'neve' ), + '', + '' + ), ), 'hfg_footer_layout_bottom_background' => array( 'label' => esc_html__( 'Change Footer Color', 'neve' ),