Skip to content

Commit

Permalink
Theme Showcase: Remove More Menu (#85315)
Browse files Browse the repository at this point in the history
* Remove theme options for fun and sanity

* Simplify the theme preview check
  • Loading branch information
Copons authored Dec 21, 2023
1 parent 18ac561 commit 7eae5e8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
16 changes: 14 additions & 2 deletions client/components/theme/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,19 @@ export class Theme extends Component {

renderMoreButton = () => {
const { active, buttonContents, index, theme } = this.props;
if ( isEmpty( buttonContents ) ) {

let moreOptions = buttonContents;
if ( isEnabled( 'themes/tiers' ) ) {
if ( active && buttonContents.info ) {
moreOptions = { info: buttonContents.info };
} else if ( buttonContents.deleteTheme ) {
moreOptions = { deleteTheme: buttonContents.deleteTheme };
} else {
moreOptions = {};
}
}

if ( isEmpty( moreOptions ) ) {
return null;
}

Expand All @@ -280,7 +292,7 @@ export class Theme extends Component {
active={ active }
onMoreButtonClick={ this.props.onMoreButtonClick }
onMoreButtonItemClick={ this.props.onMoreButtonItemClick }
options={ buttonContents }
options={ moreOptions }
/>
);
};
Expand Down
17 changes: 11 additions & 6 deletions client/my-sites/themes/theme-preview.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isEnabled } from '@automattic/calypso-config';
import page from '@automattic/calypso-router';
import { Button } from '@automattic/components';
import { createHigherOrderComponent } from '@wordpress/compose';
Expand Down Expand Up @@ -250,12 +251,16 @@ class ThemePreview extends Component {
externalUrl={ demoUrl }
belowToolbar={ this.props.belowToolbar }
>
{ showActionIndicator && <PulsingDot active={ true } /> }
{ ! showActionIndicator && this.renderSecondaryButton() }
{ ! showActionIndicator &&
( this.shouldShowUnlockStyleButton()
? this.renderUnlockStyleButton()
: this.renderPrimaryButton() ) }
{ ! isEnabled( 'themes/tiers' ) && (
<>
{ showActionIndicator && <PulsingDot active={ true } /> }
{ ! showActionIndicator && this.renderSecondaryButton() }
{ ! showActionIndicator &&
( this.shouldShowUnlockStyleButton()
? this.renderUnlockStyleButton()
: this.renderPrimaryButton() ) }
</>
) }
</WebPreview>
) }
{ showUnlockStyleUpgradeModal && (
Expand Down

0 comments on commit 7eae5e8

Please sign in to comment.