Skip to content

Commit

Permalink
Hide "Upload a logo" step in Personalize task if theme doesn't suppor…
Browse files Browse the repository at this point in the history
…t it (#38161)

* Hide upload logo step in Personalize task if theme doesn't support it

* Add changelog

* Fix lint
  • Loading branch information
chihsuan committed May 9, 2023
1 parent e06097b commit 2189cb1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 4 additions & 2 deletions plugins/woocommerce-admin/client/tasks/fills/appearance.js
Expand Up @@ -25,11 +25,13 @@ import { WooOnboardingTask } from '@woocommerce/onboarding';
class Appearance extends Component {
constructor( props ) {
super( props );
const { hasHomepage, hasProducts } = props.task.additionalData;
const { hasHomepage, hasProducts, supportCustomLogo } =
props.task.additionalData;

this.stepVisibility = {
homepage: ! hasHomepage,
import: ! hasProducts,
logo: supportCustomLogo,
};

this.state = {
Expand Down Expand Up @@ -338,7 +340,7 @@ class Appearance extends Component {
</Button>
</Fragment>
),
visible: true,
visible: this.stepVisibility.logo,
},
{
key: 'notice',
Expand Down
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Hide upload logo step in Personalize task if theme doesn't support it
Expand Up @@ -76,10 +76,11 @@ public function get_time() {
*/
public function get_additional_data() {
return array(
'has_homepage' => self::has_homepage(),
'has_products' => Products::has_products(),
'stylesheet' => get_option( 'stylesheet' ),
'theme_mods' => get_theme_mods(),
'has_homepage' => self::has_homepage(),
'has_products' => Products::has_products(),
'stylesheet' => get_option( 'stylesheet' ),
'theme_mods' => get_theme_mods(),
'support_custom_logo' => false !== get_theme_support( 'custom-logo' ),
);
}

Expand Down

0 comments on commit 2189cb1

Please sign in to comment.