2021-09-21 19:33:44 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2023-09-20 16:25:35 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { WooOnboardingTaskListItem } from '@woocommerce/onboarding';
|
2021-09-21 19:33:44 +00:00
|
|
|
import { registerPlugin } from '@wordpress/plugins';
|
2023-09-20 16:25:35 +00:00
|
|
|
import { getAdminLink } from '@woocommerce/settings';
|
2021-09-21 19:33:44 +00:00
|
|
|
|
2023-09-20 16:25:35 +00:00
|
|
|
const useAppearanceClick = () => {
|
|
|
|
const onClick = () => {
|
|
|
|
window.location = getAdminLink(
|
|
|
|
'theme-install.php?browse=block-themes'
|
2021-09-21 19:33:44 +00:00
|
|
|
);
|
2023-09-20 16:25:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return { onClick };
|
|
|
|
};
|
|
|
|
|
|
|
|
const AppearanceFill = () => {
|
|
|
|
const { onClick } = useAppearanceClick();
|
|
|
|
return (
|
|
|
|
<WooOnboardingTaskListItem id="appearance">
|
|
|
|
{ ( { defaultTaskItem: DefaultTaskItem } ) => (
|
|
|
|
<DefaultTaskItem
|
|
|
|
// Override task click so it doesn't navigate to a task component.
|
|
|
|
onClick={ onClick }
|
|
|
|
/>
|
|
|
|
) }
|
|
|
|
</WooOnboardingTaskListItem>
|
|
|
|
);
|
|
|
|
};
|
2021-09-21 19:33:44 +00:00
|
|
|
|
|
|
|
registerPlugin( 'wc-admin-onboarding-task-appearance', {
|
|
|
|
scope: 'woocommerce-tasks',
|
2023-09-20 16:25:35 +00:00
|
|
|
render: () => <AppearanceFill />,
|
2021-09-21 19:33:44 +00:00
|
|
|
} );
|