Fix "Choose Your Theme" task header (#41293)

This commit is contained in:
nigeljamesstevenson 2023-11-08 23:14:28 +00:00 committed by GitHub
commit d167337a1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 15 deletions

View File

@ -6,7 +6,7 @@ import { WooOnboardingTaskListItem } from '@woocommerce/onboarding';
import { registerPlugin } from '@wordpress/plugins';
import { getAdminLink } from '@woocommerce/settings';
const useAppearanceClick = () => {
export const useAppearanceClick = () => {
const onClick = () => {
window.location = getAdminLink(
'theme-install.php?browse=block-themes'

View File

@ -1,16 +1,24 @@
/**
* External dependencies
*/
import { Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { Button } from '@wordpress/components';
/**
* Internal dependencies
*/
import TimerImage from './timer.svg';
import { WC_ASSET_URL } from '../../../../utils/admin-settings';
import { useAppearanceClick } from '../../../fills/appearance';
const AppearanceHeader = ( { task } ) => {
const { onClick } = useAppearanceClick();
const taskTitle = task.title;
const taskDescription = task.content;
const taskCta = task.actionLabel;
const taskTime = task.time;
const AppearanceHeader = ( { task, goToTask } ) => {
return (
<div className="woocommerce-task-header__contents-container">
<img
@ -22,25 +30,18 @@ const AppearanceHeader = ( { task, goToTask } ) => {
className="svg-background"
/>
<div className="woocommerce-task-header__contents">
<h1>{ __( 'Make your store stand out', 'woocommerce' ) }</h1>
<p>
{ __(
'Add your logo, create a homepage, and start designing your store.',
'woocommerce'
) }
</p>
<h1>{ taskTitle }</h1>
<p>{ taskDescription }</p>
<Button
isSecondary={ task.isComplete }
isPrimary={ ! task.isComplete }
onClick={ goToTask }
onClick={ onClick }
>
{ task.isComplete
? __( 'Modify choices', 'woocommerce' )
: __( 'Personalize', 'woocommerce' ) }
{ taskCta }
</Button>
<p className="woocommerce-task-header__timer">
<img src={ TimerImage } alt="Timer" />{ ' ' }
<span>{ task.time }</span>
<span>{ taskTime }</span>
</p>
</div>
</div>

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix "Choose Your Theme" task header