Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Add link to helper article in version control notice #190

Merged
merged 3 commits into from
Jun 7, 2023
Merged
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
24 changes: 21 additions & 3 deletions wp-modules/app/js/src/components/VersionControlNotice/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// WP dependencies
import { __ } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { Notice } from '@wordpress/components';

type Props = {
Expand All @@ -19,9 +20,26 @@ export default function VersionControlNotice( {
status="warning"
onRemove={ handleDismiss }
>
{ __(
'No version control detected for this theme. We recommend adding version control so you do not lose your patterns during theme updates.',
'pattern-manager'
{ createInterpolateElement(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great use of createInterpolateElement()

__(
'No version control detected for this theme. We recommend adding version control so you do not lose your patterns during theme updates. <div></div>Learn how to set up git for your theme in <a></a>.',
'pattern-manager'
),
{
div: <div style={ { marginTop: '1rem' } }></div>,
a: (
<a
href={
'https://developer.wpengine.com/knowledge-base/using-git-with-a-wordpress-theme/'
}
target="_blank"
rel="noopener noreferrer"
aria-label="Link to our Git Guide (opens in new tab)"
>
{ __( 'our Git Guide', 'pattern-manager' ) }
</a>
),
}
) }
</Notice>
) : null;
Expand Down