PluginProbe
Code Snippets / 4.0.0-beta.2
Code Snippets v4.0.0-beta.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 / demo / DemoUpsell.tsx

DemoUpsell.tsx in Code Snippets 4.0.0-beta.2, at js/components/common/demo/DemoUpsell.tsx

39 lines 975 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 { Button } from '../Button'
4 import type { ReactNode } from 'react'
5
6 const PRICING_URL = 'https://codesnippets.pro/pricing/'
7
8 export interface DemoUpsellProps {
9 title: string
10 children: ReactNode
11 onReplay: VoidFunction
12 }
13
14 /**
15 * Closing panel shared by the feature walkthroughs: what the visitor just saw,
16 * what the real feature does, and the route to it.
17 */
18 export const DemoUpsell: React.FC<DemoUpsellProps> = ({ title, children, onReplay }) =>
19 <div className="demo-upsell">
20 <h2 className="demo-upsell__title">{title}</h2>
21
22 {children}
23
24 <div className="demo-upsell__actions">
25 <a
26 className="button button-primary button-large"
27 href={PRICING_URL}
28 target="_blank"
29 rel="noopener noreferrer"
30 >
31 {__('Upgrade to Pro', 'code-snippets')}
32 </a>
33
34 <Button secondary type="button" onClick={onReplay}>
35 {__('Run demo again', 'code-snippets')}
36 </Button>
37 </div>
38 </div>
39