Launch your store: Address status issues and filesystem (#45688)

* Conditionally show status on homescreen

* get lys link in status

* refactor launch-store folders

* remove unused function

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
This commit is contained in:
Paul Sealock 2024-03-20 16:26:17 +13:00 committed by GitHub
parent fda79df11b
commit 27a473ec8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 14 additions and 8 deletions

View File

@ -14,6 +14,7 @@ import {
} from '@woocommerce/admin-layout';
import { getSetting } from '@woocommerce/settings';
import { Text, useSlot } from '@woocommerce/experimental';
import { getScreenFromPath, isWCAdmin } from '@woocommerce/navigation';
/**
* Internal dependencies
@ -100,9 +101,11 @@ export const Header = ( { sections, isEmbedded = false, query } ) => {
}
}, [ isEmbedded, sections, siteTitle ] );
const isHomescreen = isWCAdmin() && getScreenFromPath() === 'homescreen';
const { isLoading, launchYourStoreEnabled, comingSoon, storePagesOnly } =
useLaunchYourStore();
const showLaunchYourStoreStatus = launchYourStoreEnabled && ! isLoading;
const showLaunchYourStoreStatus =
isHomescreen && launchYourStoreEnabled && ! isLoading;
return (
<div className={ className } ref={ headerElement }>

View File

@ -4,6 +4,7 @@
import { __ } from '@wordpress/i18n';
import { Icon, moreVertical } from '@wordpress/icons';
import { Dropdown, Button, MenuGroup, MenuItem } from '@wordpress/components';
import { getNewPath } from '@woocommerce/navigation';
import { getAdminLink } from '@woocommerce/settings';
import classnames from 'classnames';
@ -21,6 +22,9 @@ export const LaunchYourStoreStatus = ( { comingSoon, storePagesOnly } ) => {
: __( 'Coming soon', 'woocommerce' );
const liveText = __( 'Live', 'woocommerce' );
const dropdownText = isComingSoon ? comingSoonText : liveText;
const launchYourStoreLink = new URL(
getAdminLink( getNewPath( {}, '/launch-your-store', {} ) )
);
return (
<div className="woocommerce-lys-status">
<div className="woocommerce-lys-status-pill-wrapper">
@ -55,12 +59,7 @@ export const LaunchYourStoreStatus = ( { comingSoon, storePagesOnly } ) => {
) }
</MenuItem>
{ isComingSoon && (
<MenuItem
href={ getAdminLink(
// For now, waiting on the actual link.
'admin.php?page=wc-settings'
) }
>
<MenuItem href={ launchYourStoreLink.href }>
{ __(
'Customize "Coming soon" page',
'woocommerce'

View File

@ -87,7 +87,7 @@ const CustomizeStore = lazy( () =>
);
const LaunchStore = lazy( () =>
import( /* webpackChunkName: "launch-store" */ '../launch-store' )
import( /* webpackChunkName: "launch-store" */ '../launch-your-store/hub' )
);
export const PAGES_FILTER = 'woocommerce_admin_pages_list';

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Comment: Update unreleased feature