♻️ Consolidate the preview button’s CSS classes

Class names are now generated by the base class. This allows to remove a method from all derived classes
This commit is contained in:
Philipp Stracker 2024-07-15 13:18:07 +02:00
parent 7f9cbd6f58
commit 4cde024320
No known key found for this signature in database
6 changed files with 20 additions and 19 deletions

View file

@ -20,13 +20,6 @@ export default class GooglePayPreviewButton extends PreviewButton {
};
}
createNewWrapper() {
const wrapper = super.createNewWrapper();
wrapper.classList.add( 'ppcp-button-apm', 'ppcp-button-googlepay' );
return wrapper;
}
createButton( buttonConfig ) {
const button = new GooglepayButton(
'preview',

View file

@ -51,6 +51,7 @@ export default class GooglePayPreviewButtonManager extends PreviewButtonManager
return new GooglePayPreviewButton( {
selector: wrapperId,
apiConfig: this.apiConfig,
methodName: this.methodName,
} );
}
}