Skip to content

Commit

Permalink
Recurring Payments: change alignment (#13310)
Browse files Browse the repository at this point in the history
Introduce the align menu to choose left/right/center alignment for the Recurring Payments block.
  • Loading branch information
artpi authored Sep 4, 2019
1 parent 472380b commit b239943
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extensions/blocks/recurring-payments/edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ class MembershipsButtonEdit extends Component {
};

render = () => {
const { className, notices } = this.props;
const { className, notices, attributes } = this.props;
const { connected, connectURL, products } = this.state;

const { align } = attributes;
const inspectorControls = (
<InspectorControls>
<PanelBody title={ __( 'Product', 'jetpack' ) }>
Expand All @@ -343,6 +343,7 @@ class MembershipsButtonEdit extends Component {
'components-button',
'is-primary',
'is-button',
`align${ align }`,
] );
const blockContent = (
<SubmitButton
Expand Down
1 change: 1 addition & 0 deletions extensions/blocks/recurring-payments/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

.wp-block-jetpack-recurring-payments {
font-family: $default-font;
width: 100%;

.components-base-control__label {
text-align: left;
Expand Down
7 changes: 7 additions & 0 deletions extensions/blocks/recurring-payments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,16 @@ export const settings = {
customTextButtonColor: {
type: 'string',
},
align: {
type: 'string',
},
},
edit,
save: () => null,
supports: {
html: false,
align: true,
},
};

// These are Stripe Settlement currencies https://stripe.com/docs/currencies since memberships supports only Stripe ATM.
Expand Down

0 comments on commit b239943

Please sign in to comment.