PluginProbe
Code Snippets / 3.9.6
Code Snippets v3.9.6
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.9.6, at js/components/common/UpsellBanner.tsx

38 lines 1.2 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 { isLicensed } from '../../utils/screen'
6 import { Button } from './Button'
7
8 export const UpsellBanner = () => {
9 const [isDismissed, setIsDismissed] = useState(false)
10
11 return isDismissed || isLicensed() || window.CODE_SNIPPETS_EDIT?.hideUpsell
12 ? null
13 : <div className="code-snippets-upsell-banner">
14 <img
15 src={`${window.CODE_SNIPPETS?.urls.plugin}/assets/icon.svg`}
16 alt={__('Code Snippets logo', 'code-snippets')}
17 height="34"
18 />
19 <p>
20 {createInterpolateElement(
21 __('Unlock <strong>cloud sync, snippet conditions, AI features</strong> and much more with Code Snippets Pro.', 'code-snippets'),
22 { strong: <strong /> }
23 )}
24 </p>
25
26 <ExternalLink
27 className="button button-primary button-large"
28 href="https://codesnippets.pro/pricing/"
29 >
30 {__('Get Started', 'code-snippets')}
31 </ExternalLink>
32
33 <Button small link onClick={() => setIsDismissed(true)}>
34 <span className="dashicons dashicons-no-alt"></span>
35 </Button>
36 </div>
37 }
38