From 227a098da230817b87892dd579a3d236aa553ef0 Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Mon, 24 Jun 2024 12:12:38 +0530 Subject: [PATCH 1/5] calling comingSoonAdminbarToggle on update of comingsoon --- src/app/pages/home/welcomeSection.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/pages/home/welcomeSection.js b/src/app/pages/home/welcomeSection.js index ad0e1ef74..1ebdc4c04 100644 --- a/src/app/pages/home/welcomeSection.js +++ b/src/app/pages/home/welcomeSection.js @@ -1,8 +1,10 @@ import { useContext } from '@wordpress/element'; +import { useUpdateEffect } from 'react-use'; import { OnboardingScreen } from '@newfold-labs/wp-module-ecommerce'; import AppStore from 'App/data/store'; import { bluehostSettingsApiFetch } from 'App/util/helpers'; import { useNotification } from 'App/components/notifications'; +import { comingSoonAdminbarToggle } from '../../util/helpers'; const WelcomeSection = ( {} ) => { const { store, setStore } = useContext( AppStore ); @@ -16,6 +18,10 @@ const WelcomeSection = ( {} ) => { () => setStore( { ...store, comingSoon: ! store.comingSoon } ) ); + useUpdateEffect(() => { + comingSoonAdminbarToggle(store.comingSoon) + }, [store.comingSoon]) + return ( Date: Mon, 24 Jun 2024 12:22:12 +0530 Subject: [PATCH 2/5] linting issues --- src/app/pages/home/welcomeSection.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/pages/home/welcomeSection.js b/src/app/pages/home/welcomeSection.js index 1ebdc4c04..b34fe85e0 100644 --- a/src/app/pages/home/welcomeSection.js +++ b/src/app/pages/home/welcomeSection.js @@ -18,9 +18,9 @@ const WelcomeSection = ( {} ) => { () => setStore( { ...store, comingSoon: ! store.comingSoon } ) ); - useUpdateEffect(() => { - comingSoonAdminbarToggle(store.comingSoon) - }, [store.comingSoon]) + useUpdateEffect( () => { + comingSoonAdminbarToggle( store.comingSoon ) + }, [store.comingSoon] ) return ( Date: Mon, 24 Jun 2024 13:01:40 +0530 Subject: [PATCH 3/5] linting fixes --- src/app/pages/home/welcomeSection.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/pages/home/welcomeSection.js b/src/app/pages/home/welcomeSection.js index b34fe85e0..32d1bc4bc 100644 --- a/src/app/pages/home/welcomeSection.js +++ b/src/app/pages/home/welcomeSection.js @@ -18,9 +18,9 @@ const WelcomeSection = ( {} ) => { () => setStore( { ...store, comingSoon: ! store.comingSoon } ) ); - useUpdateEffect( () => { - comingSoonAdminbarToggle( store.comingSoon ) - }, [store.comingSoon] ) + useUpdateEffect( () => { + comingSoonAdminbarToggle( store.comingSoon ); + }, [ store.comingSoon ] ); return ( Date: Wed, 26 Jun 2024 14:46:00 +0530 Subject: [PATCH 4/5] fixes in store page --- src/app/pages/ecommerce/page.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/pages/ecommerce/page.js b/src/app/pages/ecommerce/page.js index d9122eaa2..6a4b97b25 100644 --- a/src/app/pages/ecommerce/page.js +++ b/src/app/pages/ecommerce/page.js @@ -7,6 +7,7 @@ import '@newfold-labs/wp-module-ecommerce/bluehost.css'; import AppStore from 'App/data/store'; import { bluehostSettingsApiFetch } from 'App/util/helpers'; import { useNotification } from 'App/components/notifications'; +import { comingSoonAdminbarToggle } from '../../util/helpers'; const ECommerce = () => { const { store, setStore } = useContext( AppStore ); @@ -33,6 +34,7 @@ const ECommerce = () => { ...store, comingSoon: ! store.comingSoon, } ); + comingSoonAdminbarToggle(!store.comingSoon) } ), }; From fd479c5caae6df4e309a5ee9b74db72c685252bd Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Wed, 26 Jun 2024 16:55:55 +0530 Subject: [PATCH 5/5] linting fixes --- src/app/pages/ecommerce/page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/ecommerce/page.js b/src/app/pages/ecommerce/page.js index 6a4b97b25..6033ad282 100644 --- a/src/app/pages/ecommerce/page.js +++ b/src/app/pages/ecommerce/page.js @@ -34,7 +34,7 @@ const ECommerce = () => { ...store, comingSoon: ! store.comingSoon, } ); - comingSoonAdminbarToggle(!store.comingSoon) + comingSoonAdminbarToggle( ! store.comingSoon ); } ), };