Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions extensions/blocks/send-a-message/editor.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
.wp-block-jetpack-send-a-message {
.block-editor-block-list__layout {
display: inline-flex;

.wp-block {
margin-top: 0px;
margin-bottom: 0px;
margin-right: 10px;
margin: 0;
}
}

Expand Down
7 changes: 6 additions & 1 deletion extensions/blocks/send-a-message/whatsapp-button/edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* External dependencies
*/
import classnames from 'classnames';
import { __, _x } from '@wordpress/i18n';
import { useEffect, useState, useCallback } from '@wordpress/element';
import { useDispatch } from '@wordpress/data';
Expand Down Expand Up @@ -191,8 +192,12 @@ export default function WhatsAppButtonEdit( { attributes, setAttributes, classNa
);
};

const getBlockClassNames = () => {
return classnames( className, colorClass ? 'is-color-' + colorClass : undefined );
};

return (
<div className={ className + ' is-color-' + colorClass }>
<div className={ getBlockClassNames() }>
{ ToolbarGroup && (
<BlockControls>
<ToolbarGroup>
Expand Down
6 changes: 6 additions & 0 deletions extensions/blocks/send-a-message/whatsapp-button/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@
padding: 12px;
}
}

.wp-block[data-align="center"] {
.wp-block-jetpack-whatsapp-button {
justify-content: center;
}
}
1 change: 1 addition & 0 deletions extensions/blocks/send-a-message/whatsapp-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const settings = {
supports: {
html: false,
reusable: false,
align: [ 'left', 'center', 'right' ],
},
attributes,
edit,
Expand Down
14 changes: 10 additions & 4 deletions extensions/blocks/send-a-message/whatsapp-button/view.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
div.wp-block-jetpack-whatsapp-button {
display: inline-block;
margin-right: 5px;
display: flex;

a.whatsapp-block__button {
background: #25D366;
color: #fff;
display: inline-block;
display: block;
padding: 8px 16px 8px 56px;
border-radius: 8px;
text-decoration: none;
Expand All @@ -28,12 +28,18 @@ div.wp-block-jetpack-whatsapp-button {
}
}

&.alignleft {
float: none;
justify-content: flex-start;
}

&.aligncenter {
text-align: center;
justify-content: center;
}

&.alignright {
text-align: right;
float: none;
justify-content: flex-end;
}

&.has-no-text {
Expand Down