♻️ 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

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

View file

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