PluginProbe
Code Snippets / 3.10.2
Code Snippets v3.10.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 / common / UpsellBanner.tsx

UpsellBanner.tsx in Code Snippets 3.10.2, at js/components/common/UpsellBanner.tsx

43 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { ExternalLink } from '@wordpress/components'
2 import { createInterpolateElement } from '@wordpress/element'
3 import { __ } from '@wordpress/i18n'
4 import React, { useState } from 'react'
5 import { shouldShowUpsell } from '../../utils/screen'
6 import { Button } from './Button'
7
8 export const UpsellBanner = () => {
9 const [isDismissed, setIsDismissed] = useState(false)
10
11 return isDismissed || !shouldShowUpsell()
12 ? null
13 : <div
14 className="code-snippets-upsell-banner"
15 aria-label={__('Upgrade to Code Snippets Pro', 'code-snippets')}
16 role="region"
17 >
18 <img
19 src={`${window.CODE_SNIPPETS?.urls.plugin}/assets/icon.svg`}
20 alt={__('Code Snippets logo', 'code-snippets')}
21 height="34"
22 aria-hidden="true"
23 />
24 <p>
25 {createInterpolateElement(
26 __('Unlock <strong>cloud sync, snippet conditions, AI features</strong> and much more with Code Snippets Pro.', 'code-snippets'),
27 { strong: <strong /> }
28 )}
29 </p>
30
31 <ExternalLink
32 className="button button-primary"
33 href="https://codesnippets.pro/pricing/"
34 >
35 {__('Get Started', 'code-snippets')}
36 </ExternalLink>
37
38 <Button small link onClick={() => setIsDismissed(true)} aria-label={__('Dismiss upsell banner', 'code-snippets')}>
39 <span className="dashicons dashicons-no-alt" aria-hidden="true"></span>
40 </Button>
41 </div>
42 }
43