Skip to content

Commit

Permalink
Merge pull request #1141 from bluehost/fix/coming-soon
Browse files Browse the repository at this point in the history
Launch Button | Calling comingSoonAdminbarToggle on update of comingsoon state
  • Loading branch information
wpalani authored Jun 26, 2024
2 parents 2c698f6 + fd479c5 commit 505a017
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/pages/ecommerce/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -33,6 +34,7 @@ const ECommerce = () => {
...store,
comingSoon: ! store.comingSoon,
} );
comingSoonAdminbarToggle( ! store.comingSoon );
}
),
};
Expand Down
6 changes: 6 additions & 0 deletions src/app/pages/home/welcomeSection.js
Original file line number Diff line number Diff line change
@@ -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 );
Expand All @@ -16,6 +18,10 @@ const WelcomeSection = ( {} ) => {
() => setStore( { ...store, comingSoon: ! store.comingSoon } )
);

useUpdateEffect( () => {
comingSoonAdminbarToggle( store.comingSoon );
}, [ store.comingSoon ] );

return (
<OnboardingScreen
comingSoon={ store.comingSoon }
Expand Down

0 comments on commit 505a017

Please sign in to comment.