Skip to content

Commit

Permalink
Themes Marketplace: Add external icon to external theme demo buttons (#…
Browse files Browse the repository at this point in the history
…94300)

* Add external icon to external theme demo buttons

* Use current color on SVG
  • Loading branch information
DustyReagan authored Sep 6, 2024
1 parent 222c9d7 commit 8e305de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/my-sites/theme/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from '@automattic/design-picker';
import { localizeUrl } from '@automattic/i18n-utils';
import { createHigherOrderComponent } from '@wordpress/compose';
import { Icon, external } from '@wordpress/icons';
import clsx from 'clsx';
import { localize, getLocaleSlug } from 'i18n-calypso';
import photon from 'photon';
Expand Down Expand Up @@ -759,6 +760,7 @@ class ThemeSheet extends Component {
! isWPForTeamsSite &&
! this.shouldRenderForStaging() &&
( ! this.hasWpOrgThemeUpsellBanner() || ! isLoggedIn );
const isExternalLink = ! this.props.isWpcomTheme || this.props.isExternallyManagedTheme;

return (
<div className="theme__sheet-header">
Expand All @@ -785,13 +787,15 @@ class ThemeSheet extends Component {
/>
{ this.shouldRenderPreviewButton() && ! isLivePreviewSupported && (
<Button
className="theme__sheet-demo-button"
onClick={ ( e ) => {
this.previewAction( e, 'link', 'actions' );
} }
>
{ translate( 'Demo site', {
context: 'The button to open the demo site of individual theme',
} ) }
{ isExternalLink && <Icon icon={ external } size={ 16 } /> }
</Button>
) }
</div>
Expand Down
8 changes: 8 additions & 0 deletions client/my-sites/theme/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ $button-border: 4px;
top: auto;
margin-right: 0 !important;
}

.theme__sheet-demo-button {
svg {
vertical-align: text-bottom;
margin-left: 4px;
fill: currentColor;
}
}
}

.theme__sheet-main-info-title {
Expand Down

0 comments on commit 8e305de

Please sign in to comment.