PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
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 / FeedbackReporter / BugDetailFields.tsx

BugDetailFields.tsx in Code Snippets trunk, at js/components/FeedbackReporter/BugDetailFields.tsx

45 lines 1.6 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 { CheckboxControl, TextareaControl } from '@wordpress/components'
3 import { __ } from '@wordpress/i18n'
4 import type { FeedbackDraft } from '../../types/Feedback'
5
6 export interface BugDetailFieldsProps {
7 draft: FeedbackDraft
8 updateDraft: (changes: Partial<FeedbackDraft>) => void
9 }
10
11 export const BugDetailFields: React.FC<BugDetailFieldsProps> = ({ draft, updateDraft }) =>
12 <>
13 <div className="code-snippets-feedback-field">
14 <TextareaControl
15 label={__('Steps to reproduce', 'code-snippets')}
16 rows={5}
17 value={draft.steps}
18 placeholder={__('1. Open a saved snippet\n2. Click the Conditions tab\n3. Switch back to Code', 'code-snippets')}
19 onChange={steps => updateDraft({ steps })}
20 />
21 </div>
22
23 <fieldset className="code-snippets-feedback-fieldset">
24 <legend>{__('Isolating the problem', 'code-snippets')}</legend>
25
26 <CheckboxControl
27 label={__('This happens with only Code Snippets active', 'code-snippets')}
28 checked={draft.isolation.plugin_only}
29 onChange={pluginOnly => updateDraft({ isolation: { ...draft.isolation, plugin_only: pluginOnly } })}
30 />
31
32 <CheckboxControl
33 label={__('This happens with a blank theme active, such as Twenty Twenty-Five', 'code-snippets')}
34 checked={draft.isolation.blank_theme}
35 onChange={blankTheme => updateDraft({ isolation: { ...draft.isolation, blank_theme: blankTheme } })}
36 />
37
38 <CheckboxControl
39 label={__('I can reproduce this consistently using the steps above', 'code-snippets')}
40 checked={draft.isolation.reproducible}
41 onChange={reproducible => updateDraft({ isolation: { ...draft.isolation, reproducible } })}
42 />
43 </fieldset>
44 </>
45