Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused methods in Theme Detail page #80129

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions client/my-sites/theme/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ import InlineSupportLink from 'calypso/components/inline-support-link';
import Main from 'calypso/components/main';
import PremiumGlobalStylesUpgradeModal from 'calypso/components/premium-global-styles-upgrade-modal';
import SectionHeader from 'calypso/components/section-header';
import SectionNav from 'calypso/components/section-nav';
import NavItem from 'calypso/components/section-nav/item';
import NavTabs from 'calypso/components/section-nav/tabs';
import PageViewTracker from 'calypso/lib/analytics/page-view-tracker';
import { decodeEntities, preventWidows } from 'calypso/lib/formatting';
import { PerformanceTrackerStop } from 'calypso/lib/performance-tracking';
Expand Down Expand Up @@ -446,21 +443,6 @@ class ThemeSheet extends Component {
return isAtomic && isPremium && ! canUserUploadThemes && ! hasUnlimitedPremiumThemes;
}

// Render "Open Live Demo" pseudo-button for mobiles.
// This is a legacy hack that shows the button under the preview screenshot for mobiles
// but not for desktop (becomes hidden behind the screenshot).
renderPreviewButton() {
return (
<div className="theme__sheet-preview-link">
<span className="theme__sheet-preview-link-text">
{ this.props.translate( 'Open live demo', {
context: 'Individual theme live preview button',
} ) }
</span>
</div>
);
}

renderScreenshot() {
const { isWpcomTheme, name: themeName, demoUrl, translate } = this.props;
const screenshotFull = isWpcomTheme ? this.getFullLengthScreenshot() : this.props.screenshot;
Expand Down Expand Up @@ -491,7 +473,6 @@ class ThemeSheet extends Component {
} }
rel="noopener noreferrer"
>
{ this.shouldRenderPreviewButton() && this.renderPreviewButton() }
{ img }
</a>
);
Expand Down Expand Up @@ -535,56 +516,6 @@ class ThemeSheet extends Component {
);
};

renderSectionNav = ( currentSection ) => {
const { siteSlug, themeId, demoUrl, translate, locale, isLoggedIn } = this.props;
const filterStrings = {
'': translate( 'Overview', { context: 'Filter label for theme content' } ),
setup: translate( 'Setup', { context: 'Filter label for theme content' } ),
support: translate( 'Support', { context: 'Filter label for theme content' } ),
};
const sitePart = siteSlug ? `/${ siteSlug }` : '';

const nav = (
<NavTabs label="Details">
{ this.getValidSections().map( ( section ) => (
<NavItem
key={ section }
path={ localizeThemesPath(
`/theme/${ themeId }${ section ? '/' + section : '' }${ sitePart }`,
locale,
! isLoggedIn
) }
selected={ section === currentSection }
>
{ filterStrings[ section ] }
</NavItem>
) ) }
{ this.shouldRenderPreviewButton() ? (
<NavItem
path={ demoUrl }
onClick={ ( e ) => {
this.previewAction( e, 'link' );
} }
className="theme__sheet-preview-nav-item"
>
{ translate( 'Open live demo', {
context: 'Individual theme live preview button',
} ) }
</NavItem>
) : null }
</NavTabs>
);

return (
<SectionNav
className="theme__sheet-section-nav"
selectedText={ filterStrings[ currentSection ] }
>
{ this.isLoaded() && nav }
</SectionNav>
);
};

renderSectionContent = () => {
const { isPremium, isWpcomTheme, supportDocumentation } = this.props;

Expand Down