From b972eddc8e112f6905aa88b622a4c398280875f2 Mon Sep 17 00:00:00 2001 From: "lokapure.girish" Date: Tue, 23 Jul 2024 22:52:46 +0530 Subject: [PATCH] removed top level nav --- inc/Admin.php | 5 +-- src/app/data/routes.js | 10 ----- src/app/pages/home/index.js | 2 - src/app/pages/products/index.js | 65 --------------------------------- 4 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 src/app/pages/products/index.js diff --git a/inc/Admin.php b/inc/Admin.php index e60eb9b0b..f9861287f 100644 --- a/inc/Admin.php +++ b/inc/Admin.php @@ -90,10 +90,7 @@ public static function subpages() { ? array( 'bluehost#/staging' => __( 'Staging', 'wp-plugin-bluehost' ), ) - : array(); - $products = array( - 'bluehost#/products' => __( 'My Products', 'wp-plugin-bluehost' ), - ); + : array(); $help = array( 'bluehost#/help' => __( 'Help', 'wp-plugin-bluehost' ), ); diff --git a/src/app/data/routes.js b/src/app/data/routes.js index 2f656860c..aa04a7f89 100644 --- a/src/app/data/routes.js +++ b/src/app/data/routes.js @@ -6,7 +6,6 @@ import { AdjustmentsHorizontalIcon, BuildingStorefrontIcon, DocumentDuplicateIcon, - Squares2X2Icon, } from '@heroicons/react/24/outline'; import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; import { Route, Routes } from 'react-router-dom'; @@ -22,7 +21,6 @@ import Admin from '../pages/admin'; import { getMarketplaceSubnavRoutes } from '@modules/wp-module-marketplace/components/marketplaceSubnav'; import { ReactComponent as HelpIcon } from '../components/icons/HelpIcon.svg'; import PagesAndPosts from '../pages/pages-and-posts'; -import Products from '../pages/products'; const addPartialMatch = ( prefix, path ) => prefix === path ? `${ prefix }/*` : path; @@ -75,7 +73,6 @@ const topRoutePaths = [ '/performance', '/settings', '/staging', - '/products', ]; const utilityRoutePaths = [ '/help' ]; @@ -169,13 +166,6 @@ export const routes = [ Component: Admin, condition: true, }, - { - name: '/products', - title: __( 'My Products', 'wp-plugin-bluehost' ), - Component: Products, - Icon: Squares2X2Icon, - condition: true, - }, ]; export const topRoutes = _filter( routes, ( route ) => diff --git a/src/app/pages/home/index.js b/src/app/pages/home/index.js index ea829614a..0dbd10a6f 100644 --- a/src/app/pages/home/index.js +++ b/src/app/pages/home/index.js @@ -10,8 +10,6 @@ const abTestShowMyProducts = NewfoldRuntime.hasCapability( 'abTestShowMyProducts' ); -console.log( NewfoldRuntime.hasCapability( 'abTestShowMyProducts' ) ); - const Home = () => { return ( diff --git a/src/app/pages/products/index.js b/src/app/pages/products/index.js deleted file mode 100644 index e5430d97c..000000000 --- a/src/app/pages/products/index.js +++ /dev/null @@ -1,65 +0,0 @@ -import { Container, Page } from '@newfold/ui-component-library'; -import apiFetch from '@wordpress/api-fetch'; -import { useState, useEffect } from '@wordpress/element'; -import { NewfoldRuntime } from '@newfold-labs/wp-module-runtime'; -import { default as NewfoldProducts } from '@newfold-labs/wp-module-my-products/components/product'; -import { isJarvis } from '../../util/helpers'; - -// constants to pass to module -const moduleConstants = { - text: { - error: __( - 'Oops, there was an error loading products, please try again later.', - 'bluehost-wordpress-plugin' - ), - noProducts: __( - 'Sorry, no products. Please, try again later.', - 'bluehost-wordpress-plugin' - ), - jarvisText: __( - 'Please login to your account manager to see products.', - 'bluehost-wordpress-plugin' - ), - }, -}; - -// methods to pass to module -const moduleMethods = { - apiFetch, - useState, - useEffect, - NewfoldRuntime, - isJarvis, -}; - -const Products = () => { - return ( - - - -

- { __( - 'A list of products associated with your Bluehost hosting package. For more information, check out the ', - 'bluehost-wordpress-plugin' - ) } - - - { __( - 'Bluehost Account Manager', - 'bluehost-wordpress-plugin' - ) } - -

-
- -
-
- ); -}; - -export default Products;