← All changes
|
js/components/ImportMenu/MigrateForm/MigrateForm.tsx
+6
-7
4.0.0-beta.1
→
trunk
View file →
| @@ -1,7 +1,8 @@ | ||
| 1 | 1 | import React from 'react' |
| 2 | 2 | import { createInterpolateElement } from '@wordpress/element' |
| 3 | 3 | import { __, sprintf } from '@wordpress/i18n' |
| 4 | +import { Notice } from '../../common/Notice' | |
| 4 | 5 | import { ImportCard } from '../common/ImportCard' |
| 5 | 6 | import { ImporterSelector } from './ImporterSelector' |
| 6 | 7 | import { ImportOptions } from './ImportOptions' |
| 7 | 8 | import { SimpleSnippetTable } from './SimpleSnippetTable' |
| @@ -45,9 +46,9 @@ | ||
| 45 | 46 | {error.message} |
| 46 | 47 | </StatusDisplay>)} |
| 47 | 48 | |
| 48 | 49 | {0 < importedIds.length && ( |
| 49 | - // translators: %d: number of imported snippets. | |
| 50 | + // translators: %d: number of imported snippets. | |
| 50 | 51 | <StatusDisplay type="success" title={sprintf(__('%d snippets imported!', 'code-snippets'), importedIds.length)}> |
| 51 | 52 | {createInterpolateElement( |
| 52 | 53 | __('Selected snippets have been successfully imported to your <a>Code Snippets library</a>.', 'code-snippets'), |
| 53 | 54 | { |
| @@ -57,10 +58,10 @@ | ||
| 57 | 58 | )} |
| 58 | 59 | </StatusDisplay>)} |
| 59 | 60 | |
| 60 | 61 | {selectedImporter && |
| 61 | - isWorking !== MigrationStep.FetchSnippets && error?.step !== MigrationStep.FetchSnippets && | |
| 62 | - 0 === snippetSelection.availableItems.length && 0 === importedIds.length && ( | |
| 62 | + isWorking !== MigrationStep.FetchSnippets && error?.step !== MigrationStep.FetchSnippets && | |
| 63 | + 0 === snippetSelection.availableItems.length && 0 === importedIds.length && ( | |
| 63 | 64 | <ImportCard className="no-snippets-card" role="status" aria-live="polite"> |
| 64 | 65 | <div className="card-inner"> |
| 65 | 66 | <div className="card-icon" aria-hidden="true">ðŸ“</div> |
| 66 | 67 | <h4>{__('No snippets found', 'code-snippets')}</h4> |
| @@ -80,19 +81,17 @@ | ||
| 80 | 81 | } |
| 81 | 82 | |
| 82 | 83 | if (error?.step === MigrationStep.LoadImporters) { |
| 83 | 84 | return ( |
| 84 | - <div className="notice notice-error"> | |
| 85 | + <Notice type="error"> | |
| 85 | 86 | {/* translators: %s: error message. */} |
| 86 | 87 | <p>{sprintf(__('Error loading importers: %s', 'code-snippets'), error.message)}</p> |
| 87 | - </div> | |
| 88 | + </Notice> | |
| 88 | 89 | ) |
| 89 | 90 | } |
| 90 | 91 | |
| 91 | 92 | return ( |
| 92 | 93 | <> |
| 93 | - <p>{__('If you are using another snippets plugin, you can import those existing snippets to your Code Snippets library.', 'code-snippets')}</p> | |
| 94 | - | |
| 95 | 94 | <ImporterSelector |
| 96 | 95 | value={selectedImporter} |
| 97 | 96 | options={importers} |
| 98 | 97 | isLoading={isWorking === MigrationStep.FetchSnippets} |