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

Blocks: link to Jetpack or wpcom support docs depending on site type #13902

Merged
merged 1 commit into from
Nov 4, 2019
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
10 changes: 7 additions & 3 deletions extensions/blocks/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Fragment } from '@wordpress/element';
* Internal dependencies
*/
import './editor.scss';
import { isAtomicSite, isSimpleSite } from '../../shared/site-type-utils';
import edit from './edit';
import save from './save';

Expand All @@ -20,6 +21,11 @@ const exampleDescription = __(
'jetpack'
);

const supportLink =
isSimpleSite() || isAtomicSite()
? 'https://en.support.wordpress.com/markdown-quick-reference/'
: 'https://jetpack.com/support/jetpack-blocks/markdown-block/';

export const settings = {
title: __( 'Markdown', 'jetpack' ),

Expand All @@ -31,9 +37,7 @@ export const settings = {
'jetpack'
) }
</p>
<ExternalLink href="https://en.support.wordpress.com/markdown-quick-reference/">
{ __( 'Support reference', 'jetpack' ) }
</ExternalLink>
<ExternalLink href={ supportLink }>{ __( 'Support reference', 'jetpack' ) }</ExternalLink>
</Fragment>
),

Expand Down
12 changes: 8 additions & 4 deletions extensions/blocks/simple-payments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import { Fragment } from '@wordpress/element';
/**
* Internal dependencies
*/
import { DEFAULT_CURRENCY } from './constants';
import { isAtomicSite, isSimpleSite } from '../../shared/site-type-utils';
import edit from './edit';
import save from './save';
import { DEFAULT_CURRENCY } from './constants';

/**
* Example image
Expand All @@ -24,6 +25,11 @@ import './editor.scss';

export const name = 'simple-payments';

const supportLink =
isSimpleSite() || isAtomicSite()
? 'https://support.wordpress.com/simple-payments/'
: 'https://jetpack.com/support/jetpack-blocks/simple-payments-block/';

export const settings = {
title: __( 'Simple Payments button', 'jetpack' ),

Expand All @@ -35,9 +41,7 @@ export const settings = {
'jetpack'
) }
</p>
<ExternalLink href="https://support.wordpress.com/simple-payments/">
{ __( 'Support reference', 'jetpack' ) }
</ExternalLink>
<ExternalLink href={ supportLink }>{ __( 'Support reference', 'jetpack' ) }</ExternalLink>
</Fragment>
),

Expand Down