diff --git a/plugins/woocommerce-admin/client/activity-panel/activity-panel.js b/plugins/woocommerce-admin/client/activity-panel/activity-panel.js index d6c338f164d..ad566b41d39 100644 --- a/plugins/woocommerce-admin/client/activity-panel/activity-panel.js +++ b/plugins/woocommerce-admin/client/activity-panel/activity-panel.js @@ -46,6 +46,7 @@ import { getUrlParams } from '~/utils'; import { useActiveSetupTasklist } from '~/task-lists'; import { getSegmentsFromPath } from '~/utils/url-helpers'; import { FeedbackIcon } from '~/products/images/feedback-icon'; +import { useLaunchYourStore } from '~/launch-your-store'; const HelpPanel = lazy( () => import( /* webpackChunkName: "activity-panels-help" */ './panels/help' ) @@ -72,6 +73,7 @@ export const ActivityPanel = ( { isEmbedded, query } ) => { const hasExtendedNotifications = Boolean( fills?.length ); const { updateUserPreferences, ...userData } = useUserPreferences(); const activeSetupList = useActiveSetupTasklist(); + const { comingSoon } = useLaunchYourStore(); const closePanel = () => { setIsPanelClosing( true ); @@ -372,7 +374,11 @@ export const ActivityPanel = ( { isEmbedded, query } ) => { const previewStore = { name: 'previewStore', - title: __( 'Preview store', 'woocommerce' ), + title: + ( comingSoon === 'yes' && + __( 'Preview store', 'woocommerce' ) ) || + ( comingSoon === 'no' && __( 'View store', 'woocommerce' ) ) || + '', visible: isHomescreen() && query.task !== 'appearance', onClick: () => { window.open( getAdminSetting( 'shopUrl' ) ); diff --git a/plugins/woocommerce-admin/client/activity-panel/test/index.js b/plugins/woocommerce-admin/client/activity-panel/test/index.js index 8e0f3c4ef3d..d364494557f 100644 --- a/plugins/woocommerce-admin/client/activity-panel/test/index.js +++ b/plugins/woocommerce-admin/client/activity-panel/test/index.js @@ -32,6 +32,14 @@ jest.mock( '@woocommerce/admin-layout', () => { }; } ); +jest.mock( '~/launch-your-store', () => ( { + useLaunchYourStore: jest.fn( () => ( { + comingSoon: 'yes', + launchYourStoreEnabled: true, + isLoading: true, + } ) ), +} ) ); + jest.mock( '@woocommerce/data', () => ( { ...jest.requireActual( '@woocommerce/data' ), useUser: jest.fn().mockReturnValue( { currentUserCan: () => true } ), diff --git a/plugins/woocommerce/changelog/47315-update-47308-toolbar-should-say-view-store-when-site-is-live b/plugins/woocommerce/changelog/47315-update-47308-toolbar-should-say-view-store-when-site-is-live new file mode 100644 index 00000000000..599fb572699 --- /dev/null +++ b/plugins/woocommerce/changelog/47315-update-47308-toolbar-should-say-view-store-when-site-is-live @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Updated the toolbar's store link based on the site's visibility settings. \ No newline at end of file