Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update JP block style consistency after core update #14371

Merged
merged 19 commits into from
Jan 17, 2020
Merged
Show file tree
Hide file tree
Changes from 16 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
18 changes: 7 additions & 11 deletions extensions/blocks/contact-form/components/jetpack-contact-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ class JetpackContactForm extends Component {
};
}

getIntroMessage() {
return __(
'You’ll receive an email notification each time someone fills out the form. Where should it go, and what should the subject line be?',
'jetpack'
);
}

getEmailHelpMessage() {
return __( 'You can enter multiple email addresses separated by commas.', 'jetpack' );
}
Expand Down Expand Up @@ -270,18 +263,21 @@ class JetpackContactForm extends Component {
icon={ renderMaterialIcon(
<Path d="M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z" />
) }
instructions={ __(
'You’ll receive an email notification each time someone fills out the form. Where should it go, and what should the subject line be?',
'jetpack'
) }
>
<form onSubmit={ this.onFormSettingsSet }>
<p className="jetpack-contact-form__intro-message">{ this.getIntroMessage() }</p>
{ this.renderToAndSubjectFields() }
<p className="jetpack-contact-form__intro-message">
<div class="components-placeholder__instructions">
{ __(
'(If you leave these blank, notifications will go to the author with the post or page title as the subject line.)',
'jetpack'
) }
</p>
</div>
<div className="jetpack-contact-form__create">
<Button isPrimary type="submit" disabled={ this.hasEmailError() }>
<Button isDefault type="submit" disabled={ this.hasEmailError() }>
davemart-in marked this conversation as resolved.
Show resolved Hide resolved
{ __( 'Add form', 'jetpack' ) }
</Button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions extensions/blocks/contact-form/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
}

.help-message {
color: $dark-gray-150;
width: 100%;
margin: -18px 0 28px;
margin: 0 0 1em;
}

.components-base-control {
margin-bottom: 16px;
width: 100%;
}
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/blocks/gif/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class GifEdit extends Component {
onChange={ value => setAttributes( { searchText: value } ) }
value={ searchText }
/>
<Button isLarge onClick={ this.onSubmit }>
<Button isDefault onClick={ this.onSubmit }>
{ __( 'Search', 'jetpack' ) }
</Button>
</form>
Expand Down
10 changes: 6 additions & 4 deletions extensions/blocks/gif/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
.components-base-control__field {
text-align: center;
}
.components-placeholder__label svg {
margin-right: 1ch;
jeherve marked this conversation as resolved.
Show resolved Hide resolved
}
.wp-block-jetpack-gif_cover {
background: none;
border: none;
Expand All @@ -27,17 +30,16 @@
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
margin: 0 auto;
max-width: 400px;
width: 100%;
z-index: 1;
.components-text-control__input {
height: 36px;
davemart-in marked this conversation as resolved.
Show resolved Hide resolved
}
.components-base-control__label {
position: absolute;
top: -1000em;
}
.components-button {
margin-top: 1px;
}
}
.wp-block-jetpack-gif_input {
flex-grow: 1;
Expand Down
27 changes: 14 additions & 13 deletions extensions/blocks/mailchimp/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,23 +149,24 @@ class MailchimpSubscribeEdit extends Component {
</Placeholder>
);
const placeholder = (
<Placeholder icon={ icon } label={ __( 'Mailchimp', 'jetpack' ) } notices={ notices }>
<div className="components-placeholder__instructions">
{ __(
'You need to connect your Mailchimp account and choose a list in order to start collecting Email subscribers.',
'jetpack'
) }
<br />
<br />
<Placeholder
className="wp-block-jetpack-mailchimp"
icon={ icon }
label={ __( 'Mailchimp', 'jetpack' ) }
notices={ notices }
instructions={ __(
'You need to connect your Mailchimp account and choose a list in order to start collecting Email subscribers.',
'jetpack'
) }
>
<div>
<Button isDefault isLarge href={ connectURL } target="_blank">
{ __( 'Set up Mailchimp form', 'jetpack' ) }
</Button>
<br />
jeherve marked this conversation as resolved.
Show resolved Hide resolved
<br />
<Button isLink onClick={ this.apiCall }>
{ __( 'Re-check Connection', 'jetpack' ) }
</Button>
</div>
<Button isLink onClick={ this.apiCall }>
{ __( 'Re-check Connection', 'jetpack' ) }
</Button>
</Placeholder>
);
const inspectorControls = (
Expand Down
10 changes: 10 additions & 0 deletions extensions/blocks/mailchimp/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

.wp-block-jetpack-mailchimp {

.components-placeholder__label svg {
margin-right: 1ch;
jeherve marked this conversation as resolved.
Show resolved Hide resolved
}

.wp-block-jetpack-mailchimp_notification {
display: block;
}
Expand All @@ -26,4 +30,10 @@
margin-top: 0;
}

.components-placeholder__fieldset {
display: block;
flex-direction: unset;
flex-wrap: unset;
}

}
67 changes: 39 additions & 28 deletions extensions/blocks/map/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,36 +211,47 @@ class MapEdit extends Component {
<Spinner />
</Placeholder>
);

const instructions = (
<Fragment>
{ __( 'To use the map block, you need an Access Token.', 'jetpack' ) }
<br />
<ExternalLink href="https://www.mapbox.com">
{ __( 'Create an account or log in to Mapbox.', 'jetpack' ) }
</ExternalLink>
<br />
{ __(
'Locate and copy the default access token. Then, paste it into the field below.',
'jetpack'
) }
</Fragment>
);
const placeholderAPIStateFailure = (
<Placeholder icon={ settings.icon } label={ __( 'Map', 'jetpack' ) } notices={ notices }>
<Placeholder
icon={ settings.icon }
label={ __( 'Map', 'jetpack' ) }
notices={ notices }
instructions={ instructions }
>
<Fragment>
<div className="components-placeholder__instructions">
{ __( 'To use the map block, you need an Access Token.', 'jetpack' ) }
<br />
<ExternalLink href="https://www.mapbox.com">
{ __( 'Create an account or log in to Mapbox.', 'jetpack' ) }
</ExternalLink>
<br />
{ __(
'Locate and copy the default access token. Then, paste it into the field below.',
'jetpack'
) }
</div>
<TextControl
className="wp-block-jetpack-map-components-text-control-api-key"
disabled={ apiRequestOutstanding }
placeholder={ __( 'Paste Token Here', 'jetpack' ) }
value={ apiKeyControl }
onChange={ this.updateAPIKeyControl }
/>
<Button
className="wp-block-jetpack-map-components-text-control-api-key-submit"
isLarge
disabled={ apiRequestOutstanding || ! apiKeyControl || apiKeyControl.length < 1 }
onClick={ this.updateAPIKey }
>
{ __( 'Set Token', 'jetpack' ) }
</Button>
<form>
<TextControl
className="wp-block-jetpack-map-components-text-control-api-key"
disabled={ apiRequestOutstanding }
placeholder={ __( 'Paste Token Here', 'jetpack' ) }
value={ apiKeyControl }
onChange={ this.updateAPIKeyControl }
/>
<Button
className="wp-block-jetpack-map-components-text-control-api-key-submit"
isLarge
isSecondary
disabled={ apiRequestOutstanding || ! apiKeyControl || apiKeyControl.length < 1 }
onClick={ this.updateAPIKey }
>
{ __( 'Set Token', 'jetpack' ) }
</Button>
</form>
</Fragment>
</Placeholder>
);
Expand Down
2 changes: 1 addition & 1 deletion extensions/blocks/pinterest/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class PinterestEdit extends Component {
placeholder={ __( 'Enter URL to embed here…', 'jetpack' ) }
onChange={ event => this.setState( { editedUrl: event.target.value } ) }
/>
<Button isLarge type="submit">
<Button isLarge isSecondary type="submit">
{ _x( 'Embed', 'button label', 'jetpack' ) }
</Button>
{ cannotEmbed && (
Expand Down
20 changes: 8 additions & 12 deletions extensions/blocks/recurring-payments/edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -406,19 +406,15 @@ class MembershipsButtonEdit extends Component {
icon={ <BlockIcon icon={ icon } /> }
label={ __( 'Recurring Payments', 'jetpack' ) }
notices={ notices }
instructions={ __(
"You'll need to upgrade your plan to use the Recurring Payments button.",
'jetpack'
) }
>
<div className="components-placeholder__instructions">
<p>
{ __(
"You'll need to upgrade your plan to use the Recurring Payments button.",
'jetpack'
) }
</p>
<Button isDefault isLarge href={ this.state.upgradeURL } target="_blank">
{ __( 'Upgrade Your Plan', 'jetpack' ) }
</Button>
{ this.renderDisclaimer() }
</div>
<Button isSecondary isLarge href={ this.state.upgradeURL } target="_blank">
{ __( 'Upgrade Your Plan', 'jetpack' ) }
</Button>
{ this.renderDisclaimer() }
</Placeholder>
</div>
) }
Expand Down
11 changes: 2 additions & 9 deletions extensions/blocks/recurring-payments/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
text-align: left;
}

.components-button {
display: inline-block;
margin-bottom: 20px;
}

.components-placeholder {
min-height: 150px;
padding: 24px;
Expand All @@ -25,10 +20,6 @@
margin: 0 0 20px;
}
}

&__instructions {
margin-bottom: 0;
}
}

.editor-rich-text__inline-toolbar {
Expand All @@ -45,10 +36,12 @@

&__disclaimer {
color: var( --color-gray-200 );
flex-basis: 100%;
margin: 0;
font-style: italic;
a {
color: var( --color-gray-400 );
line-height: 36px;
}
}

Expand Down
8 changes: 7 additions & 1 deletion extensions/blocks/repeat-visitor/editor.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.wp-block-jetpack-repeat-visitor {
.components-notice {
margin: 1em 0 0;
&__content {
color: var( --color-black );
}
}
.components-radio-control__option {
text-align: left;
Expand Down Expand Up @@ -32,6 +35,7 @@
flex-wrap: nowrap;
.components-base-control {
flex-basis: 100%;
margin-bottom: 0;
}
}

Expand All @@ -49,9 +53,11 @@
margin-right: 20px;

.components-text-control__input {
width: 5em;
margin-left: 12px;
text-align: center;
width: 5em;
}

}

// Overrides to make the preview look good
Expand Down