Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions src/components/site-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { __ } from '@wordpress/i18n';
import { tip, warning, trash, chevronRight, chevronDown, chevronLeft } from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import { FormEvent, useRef, useState } from 'react';
import { ACCEPTED_IMPORT_FILE_TYPES, STUDIO_DOCS_URL_IMPORT_EXPORT } from '../constants';
import {
ACCEPTED_IMPORT_FILE_TYPES,
STUDIO_DOCS_URL_IMPORT_EXPORT,
STUDIO_DOCS_URL_SITES,
} from '../constants';
import { cx } from '../lib/cx';
import { getIpcApi } from '../lib/get-ipc-api';
import Button from './button';
Expand Down Expand Up @@ -315,15 +319,31 @@ export const SiteForm = ( {
: 'max-h-0 opacity-0 mb-0'
) }
>
<label
<div
className={ cx(
'flex flex-col gap-1.5 leading-4',
isAdvancedSettingsVisible ? 'py-2' : 'p-2',
! isAdvancedSettingsVisible && 'hidden'
) }
>
<span onClick={ onSelectPath } className="font-semibold">
<label onClick={ onSelectPath } className="font-semibold">
{ __( 'Local path' ) }
</label>
<span className="text-a8c-gray-50 text-xs">
{ createInterpolateElement(
__(
'Select an empty directory or a directory with an existing WordPress site. <button>Learn more</button>'
),
{
button: (
<Button
variant="link"
className="text-xs"
onClick={ () => getIpcApi().openURL( STUDIO_DOCS_URL_SITES ) }
/>
),
}
) }
</span>
<FormPathInputComponent
isDisabled={ isPathInputDisabled }
Expand All @@ -332,7 +352,7 @@ export const SiteForm = ( {
value={ sitePath }
onClick={ onSelectPath }
/>
</label>
</div>
</div>
</>
) }
Expand Down
2 changes: 2 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const AI_GUIDELINES_URL = 'https://automattic.com/ai-guidelines/';
export const STUDIO_DOCS_URL = `https://developer.wordpress.com/docs/developer-tools/studio/`;
export const STUDIO_DOCS_URL_IMPORT_EXPORT =
'https://developer.wordpress.com/docs/developer-tools/studio/import-export';
export const STUDIO_DOCS_URL_SITES =
'https://developer.wordpress.com/docs/developer-tools/studio/sites/';
export const BUG_REPORT_URL =
'https://github.com/Automattic/studio/issues/new?assignees=&labels=Needs+triage%2C%5BType%5D+Bug&projects=&template=bug_report.yml';
export const FEATURE_REQUEST_URL =
Expand Down