PluginProbe
Code Snippets / 4.0.0-beta.2
Code Snippets v4.0.0-beta.2
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / js / components / ImportMenu / MigrateForm / ImportOptions.tsx

ImportOptions.tsx in Code Snippets 4.0.0-beta.2, at js/components/ImportMenu/MigrateForm/ImportOptions.tsx

46 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from 'react'
2 import { __ } from '@wordpress/i18n'
3 import { ImportCard } from '../common/ImportCard'
4 import { useMigrationOptions } from './WithMigrationOptions'
5
6 export const ImportOptions: React.FC = () => {
7 const { autoAddTags, setAutoAddTags, tagValue, setTagValue } = useMigrationOptions()
8
9 return (
10 <ImportCard className="import-options-card">
11 <h3>{__('Import options', 'code-snippets')}</h3>
12 <label>
13 <input
14 type="checkbox"
15 checked={autoAddTags}
16 onChange={event => setAutoAddTags(event.target.checked)}
17 aria-labelledby="code-snippets-import-auto-add-tags-label"
18 />
19 <div>
20 <div>
21 <strong id="code-snippets-import-auto-add-tags-label">
22 {__('Add tag automatically', 'code-snippets')}
23 </strong>
24 <br />
25 <span className="description">
26 {__('For your convenience, we can add a tag on every imported snippet.', 'code-snippets')}
27 </span>
28 </div>
29 {autoAddTags && (
30 <div className="import-tag-entry">
31 <input
32 id="import-auto-tag"
33 type="text"
34 value={tagValue}
35 onChange={event => setTagValue(event.target.value)}
36 placeholder={__('Add tag…', 'code-snippets')}
37 aria-label={__('Tag to add to imported snippets', 'code-snippets')}
38 className="regular-text"
39 />
40 </div>)}
41 </div>
42 </label>
43 </ImportCard>
44 )
45 }
46