Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
13 changes: 2 additions & 11 deletions src/components/content-tab-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { PropsWithChildren } from 'react';
import { decodePassword } from 'common/lib/passwords';
import { CopyTextButton } from 'src/components/copy-text-button';
import DeleteSite from 'src/components/delete-site';
import { LearnMoreLink } from 'src/components/learn-more';
import { useGetWpVersion } from 'src/hooks/use-get-wp-version';
import { getIpcApi } from 'src/lib/get-ipc-api';
import EditSiteDetails from 'src/modules/site-settings/edit-site-details';
Expand Down Expand Up @@ -105,17 +106,7 @@ export function ContentTabSettings( { selectedSite }: ContentTabSettingsProps )
'You need to trust this certificate to prevent your browser from showing a secure connection warning.'
) }
</span>{ ' ' }
<Button
variant="link"
onClick={ () => {
getIpcApi().openURL(
'https://developer.wordpress.com/docs/developer-tools/studio/ssl-in-studio/'
);
} }
>
{ __( 'Learn how' ) }
<span aria-label={ __( '(opens in a web browser)' ) }>&#8599;</span>
</Button>
<LearnMoreLink docsLinksKey="docsSslInStudio" learnHow />
</div>
) }
</SettingsRow>
Expand Down
4 changes: 3 additions & 1 deletion src/components/learn-more.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import { useI18nLocale } from 'src/stores';
export function LearnMoreLink( {
docsLinksKey,
className,
learnHow,
}: {
docsLinksKey: DocsLinkKey;
className?: string;
learnHow?: boolean;
} ) {
const { __ } = useI18n();
const locale = useI18nLocale();
Expand All @@ -24,7 +26,7 @@ export function LearnMoreLink( {
} }
variant="link"
>
{ __( 'Learn more' ) }
{ learnHow ? __( 'Learn how' ) : __( 'Learn more' ) }
</Button>
);
}
3 changes: 3 additions & 0 deletions src/lib/get-localized-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const DOCS_LINKS = {
docsXdebug: {
en: 'https://developer.wordpress.com/docs/developer-tools/studio/xdebug/',
},
docsSslInStudio: {
en: 'https://developer.wordpress.com/docs/developer-tools/studio/ssl-in-studio/',
},
} satisfies Record< `docs${ string }`, TranslatedLink >;

const BLOG_LINKS = {
Expand Down
13 changes: 1 addition & 12 deletions src/modules/add-site/components/create-site-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { LearnMoreLink } from 'src/components/learn-more';
import TextControlComponent from 'src/components/text-control';
import { WPVersionSelector } from 'src/components/wp-version-selector';
import { cx } from 'src/lib/cx';
import { getIpcApi } from 'src/lib/get-ipc-api';
import { AllowedPHPVersion } from 'src/lib/wordpress-provider/constants';
import { useRootSelector } from 'src/stores';
import { useCheckCertificateTrustQuery } from 'src/stores/certificate-trust-api';
Expand Down Expand Up @@ -380,17 +379,7 @@ export const CreateSiteForm = ( {
{ __(
'You need to manually add the Studio root certificate authority to your keychain and trust it to enable HTTPS.'
) }{ ' ' }
<Button
variant="link"
onClick={ () => {
getIpcApi().openURL(
'https://developer.wordpress.com/docs/developer-tools/studio/ssl-in-studio/'
);
} }
>
{ __( 'Learn how' ) }
<span aria-label={ __( '(opens in a web browser)' ) }>&#8599;</span>
</Button>
<LearnMoreLink docsLinksKey="docsSslInStudio" learnHow />
</div>
) }
</div>
Expand Down
12 changes: 1 addition & 11 deletions src/modules/site-settings/edit-site-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,7 @@ const EditSiteDetails = ( { currentWpVersion, onSave }: EditSiteDetailsProps ) =
{ __(
'You need to manually add the Studio certificate authority to your keychain and trust it.'
) }{ ' ' }
<Button
variant="link"
onClick={ () => {
getIpcApi().openURL(
'https://developer.wordpress.com/docs/developer-tools/studio/ssl-in-studio/'
);
} }
>
{ __( 'Learn how' ) }
<span aria-label={ __( '(opens in a web browser)' ) }>&#8599;</span>
</Button>
<LearnMoreLink docsLinksKey="docsSslInStudio" learnHow />
</div>
) }
</div>
Expand Down