From e70fe6752a06b07420da7f0165436522743503f9 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Thu, 9 May 2024 12:11:00 -0400 Subject: [PATCH] use features API for nav items --- inc/Data.php | 3 +-- src/app/data/routes.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/inc/Data.php b/inc/Data.php index 893e08455..ee758486f 100644 --- a/inc/Data.php +++ b/inc/Data.php @@ -29,8 +29,7 @@ public static function runtime() { 'version' => BLUEHOST_PLUGIN_VERSION, 'assets' => BLUEHOST_PLUGIN_URL . 'assets/', 'brand' => $bluehost_module_container->plugin()->brand, - ), - 'features' => getFeatures(), // just for now until we expose via js api endpoint + ) ); return $runtime; diff --git a/src/app/data/routes.js b/src/app/data/routes.js index 25f544f3d..93f5a7c96 100644 --- a/src/app/data/routes.js +++ b/src/app/data/routes.js @@ -133,7 +133,7 @@ export const routes = [ title: __( 'Performance', 'wp-plugin-bluehost' ), Component: Performance, Icon: BoltIcon, - condition: window.NewfoldRuntime.features.performance, + condition: await window.NewfoldFeatures.isEnabled( 'performance' ), }, { name: '/settings', @@ -147,7 +147,7 @@ export const routes = [ title: __( 'Staging', 'wp-plugin-bluehost' ), Component: Staging, Icon: WrenchScrewdriverIcon, - condition: window.NewfoldRuntime.features.staging, + condition: await window.NewfoldFeatures.isEnabled( 'staging' ), }, { name: '/help',