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 / FeedbackSuccess.tsx

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

27 lines 977 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 { __, sprintf } from '@wordpress/i18n'
3 import type { FeedbackReportResponse } from '../../types/Feedback'
4
5 export interface FeedbackSuccessProps {
6 result: FeedbackReportResponse
7 }
8
9 /** Only a tracker link the plugin published is worth offering as one. */
10 const isTrackerUrl = (url: string): boolean => url.startsWith('https://github.com/')
11
12 export const FeedbackSuccess: React.FC<FeedbackSuccessProps> = ({ result }) =>
13 <div className="code-snippets-feedback-success">
14 <h3>{__('Report sent', 'code-snippets')}</h3>
15 <p>
16 {result.reference
17 // translators: %s: reference number identifying the report.
18 ? sprintf(__('Reference %s.', 'code-snippets'), result.reference)
19 : __('The team will pick it up from here.', 'code-snippets')}
20 {' '}
21 {result.url && isTrackerUrl(result.url) &&
22 <a href={result.url} target="_blank" rel="noopener noreferrer">
23 {__('Track it on GitHub', 'code-snippets')}
24 </a>}
25 </p>
26 </div>
27