PluginProbe
Code Snippets / 3.5.0
Code Snippets v3.5.0
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 / Edit / fields / PriorityInput.tsx

PriorityInput.tsx in Code Snippets 3.5.0, at js/Edit/fields/PriorityInput.tsx

25 lines 844 B
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 { SnippetInputProps } from '../../types/SnippetInputProps'
4 import { getSnippetType } from '../../utils/snippets'
5
6 export const PriorityInput: React.FC<SnippetInputProps> = ({ snippet, setSnippet, isReadOnly }) =>
7 'html' === getSnippetType(snippet) ? null :
8 <p
9 className="snippet-priority"
10 title={__('Snippets with a lower priority number will run before those with a higher number.', 'code-snippets')}
11 >
12 <label htmlFor="snippet_priority">{`${__('Priority', 'code-snippets')} `}</label>
13 <input
14 type="number"
15 id="snippet_priority"
16 name="snippet_priority"
17 value={snippet.priority}
18 disabled={isReadOnly}
19 onChange={event => setSnippet(previous => ({
20 ...previous,
21 priority: parseInt(event.target.value, 10)
22 }))}
23 />
24 </p>
25