-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CYS - Ensure the offline modal is displayed whenever AI is unavailable (
#42949) * Show the ai offline modal independently from the onboarding tour * Add changefile(s) from automation for the following project(s): woocommerce * Remove log * Fix tests * Add customizing parameter to avoid showing the aioffline modal when customizing --------- Co-authored-by: github-actions <github-actions@github.com>
- Loading branch information
Showing
6 changed files
with
132 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...ocommerce-admin/client/customize-store/assembler-hub/onboarding-tour/ai-offline-modal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { Button, Modal } from '@wordpress/components'; | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
type AiOfflineModalProps = { | ||
skipTour: () => void; | ||
takeTour: () => void; | ||
shouldTourBeShown: boolean; | ||
}; | ||
|
||
export const AiOfflineModal = ( { | ||
skipTour, | ||
takeTour, | ||
shouldTourBeShown, | ||
}: AiOfflineModalProps ) => { | ||
return ( | ||
<Modal | ||
className="woocommerce-customize-store__onboarding-welcome-modal" | ||
title={ __( 'Welcome to your store!', 'woocommerce' ) } | ||
onRequestClose={ skipTour } | ||
shouldCloseOnClickOutside={ false } | ||
> | ||
<span className="woocommerce-customize-store__title"> | ||
{ __( | ||
'Our AI tool had a few issues generating your content.', | ||
'woocommerce' | ||
) } | ||
</span> | ||
<p> | ||
{ __( | ||
"But don't let that stop you! Start customizing the look and feel of your store by adding your logo and selecting your colors and layout. ", | ||
'woocommerce' | ||
) } | ||
{ shouldTourBeShown && | ||
__( | ||
"Take a quick tour to discover what's possible.", | ||
'woocommerce' | ||
) } | ||
</p> | ||
{ shouldTourBeShown && ( | ||
<div className="woocommerce-customize-store__design-change-warning-modal-footer"> | ||
<Button onClick={ skipTour } variant="link"> | ||
{ __( 'Skip', 'woocommerce' ) } | ||
</Button> | ||
<Button onClick={ takeTour } variant="primary"> | ||
{ __( 'Take a tour', 'woocommerce' ) } | ||
</Button> | ||
</div> | ||
) } | ||
</Modal> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: enhancement | ||
|
||
Ensure the offline modal is displayed whenever AI is unavailable and not just on the initial store setup. |