Skip to content

Commit 2c73c8e

Browse files
author
Xavier Lozano Carreras
committed
Remove unnecessary code
1 parent 0e2abee commit 2c73c8e

File tree

1 file changed

+20
-34
lines changed

1 file changed

+20
-34
lines changed

client/my-sites/theme/main.jsx

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,14 +1119,19 @@ class ThemeSheet extends Component {
11191119
const section = this.validateSection( this.props.section );
11201120
const {
11211121
themeId,
1122-
site,
11231122
siteId,
11241123
translate,
11251124
isExternallyManagedTheme,
11261125
isLoggedIn,
11271126
isThemeActivationSyncStarted,
11281127
successNotice: showSuccessNotice,
11291128
} = this.props;
1129+
const {
1130+
isWide,
1131+
isSiteSelectorModalVisible,
1132+
showEligibilityWarningsModal,
1133+
showUnlockStyleUpgradeModal,
1134+
} = this.state;
11301135
const analyticsPath = `/theme/${ themeId }${ section ? '/' + section : '' }${
11311136
siteId ? '/:site' : ''
11321137
}`;
@@ -1175,6 +1180,13 @@ class ThemeSheet extends Component {
11751180
{ label: title },
11761181
];
11771182

1183+
const dismissEligibilityWarnings = () => {
1184+
recordTracksEvent( 'calypso_automated_transfer_eligibility_modal_dismiss', {
1185+
theme: themeId,
1186+
} );
1187+
this.setState( { showEligibilityWarningsModal: false } );
1188+
};
1189+
11781190
return (
11791191
<Main className="theme__sheet">
11801192
<QueryEligibility siteId={ siteId } />
@@ -1200,7 +1212,7 @@ class ThemeSheet extends Component {
12001212
) /* TODO: Make QueryActiveTheme handle falsey siteId */
12011213
}
12021214
<ThemeSiteSelectorModal
1203-
isOpen={ this.state.isSiteSelectorModalVisible }
1215+
isOpen={ isSiteSelectorModalVisible }
12041216
onClose={ ( args ) => {
12051217
this.setState( { isSiteSelectorModalVisible: false } );
12061218

@@ -1223,10 +1235,7 @@ class ThemeSheet extends Component {
12231235
}
12241236
} }
12251237
/>
1226-
<NavigationHeader
1227-
navigationItems={ navigationItems }
1228-
compactBreadcrumb={ ! this.state.isWide }
1229-
/>
1238+
<NavigationHeader navigationItems={ navigationItems } compactBreadcrumb={ ! isWide } />
12301239
<div className={ columnsClassName }>
12311240
<div className="theme__sheet-column-header">
12321241
{ this.renderStagingPaidThemeNotice() }
@@ -1246,7 +1255,7 @@ class ThemeSheet extends Component {
12461255
checkout={ this.onPremiumGlobalStylesUpgradeModalCheckout }
12471256
tryStyle={ this.onPremiumGlobalStylesUpgradeModalTryStyle }
12481257
closeModal={ this.onPremiumGlobalStylesUpgradeModalClose }
1249-
isOpen={ this.state.showUnlockStyleUpgradeModal }
1258+
isOpen={ showUnlockStyleUpgradeModal }
12501259
/>
12511260
<PerformanceTrackerStop />
12521261
{ isThemeActivationSyncStarted && (
@@ -1257,48 +1266,25 @@ class ThemeSheet extends Component {
12571266
onFailure={ this.onAtomicThemeActiveFailure }
12581267
/>
12591268
) }
1260-
{ this.state.showEligibilityWarningsModal && (
1269+
{ showEligibilityWarningsModal && (
12611270
<Modal
12621271
className="eligibility-warnings-modal__dialog-content"
12631272
title={ translate( 'Before you continue' ) }
1264-
onRequestClose={ () => {
1265-
recordTracksEvent( 'calypso_automated_transfer_eligibility_modal_dismiss', {
1266-
// flow: 'onboarding',
1267-
theme: themeId,
1268-
} );
1269-
this.setState( { showEligibilityWarningsModal: false } );
1270-
} }
1273+
onRequestClose={ dismissEligibilityWarnings }
12711274
size="medium"
12721275
>
12731276
<EligibilityWarnings
1274-
siteId={ site?.ID }
1277+
siteId={ siteId }
12751278
standaloneProceed
1276-
// isOnboarding
12771279
isMarketplace={ isExternallyManagedTheme }
1278-
// currentContext="plugin-details"
12791280
onProceed={ () => {
12801281
this.onButtonClick();
12811282
this.setState( { showEligibilityWarningsModal: false } );
12821283
} }
1283-
onDismiss={ () => {
1284-
recordTracksEvent( 'calypso_automated_transfer_eligibility_modal_dismiss', {
1285-
// flow: 'onboarding',
1286-
theme: themeId,
1287-
} );
1288-
this.setState( { showEligibilityWarningsModal: false } );
1289-
} }
1284+
onDismiss={ dismissEligibilityWarnings }
12901285
/>
12911286
</Modal>
12921287
) }
1293-
{ /* <EligibilityWarningsModal
1294-
site={ site ?? undefined }
1295-
isMarketplace={ isExternallyManagedTheme }
1296-
isOpen={ this.state.showEligibilityWarningsModal }
1297-
@@ -1270,7 +1304,7 @@ class ThemeSheet extends Component {
1298-
this.onButtonClick();
1299-
this.setState( { showEligibilityWarningsModal: false } );
1300-
} }
1301-
/> */ }
13021288
</Main>
13031289
);
13041290
};

0 commit comments

Comments
 (0)