PluginProbe
Code Snippets / 3.9.1
Code Snippets v3.9.1
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 / EditorSidebar / controls / PriorityInput.tsx

PriorityInput.tsx in Code Snippets 3.9.1, at js/components/EditorSidebar/controls/PriorityInput.tsx

35 lines 878 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 { useSnippetForm } from '../../../hooks/useSnippetForm'
4 import { Tooltip } from '../../common/Tooltip'
5
6 export const PriorityInput = () => {
7 const { snippet, isReadOnly, setSnippet } = useSnippetForm()
8
9 return (
10 <div className="snippet-priority inline-form-field">
11 <h4>
12 <label htmlFor="snippet-priority">
13 {__('Priority', 'code-snippets')}
14 </label>
15 </h4>
16
17 <Tooltip block end>
18 {__('Snippets with a lower priority number will run before those with a higher number.', 'code-snippets')}
19 </Tooltip>
20
21 <input
22 type="number"
23 id="snippet-priority"
24 name="snippet_priority"
25 value={snippet.priority}
26 disabled={isReadOnly}
27 onChange={event => setSnippet(previous => ({
28 ...previous,
29 priority: parseInt(event.target.value, 10)
30 }))}
31 />
32 </div>
33 )
34 }
35