@@ -17,30 +17,13 @@ const upgradePlanCosts: Record<string, number> = {
17
17
[ LARGE_PLAN_SITES ] : 119
18
18
}
19
19
20
- export const UpgradeDialog : React . FC < UpgradeDialogProps > = ( { isOpen , setIsOpen } ) => {
20
+ const UpgradeDialogPlans = ( ) => {
21
21
const [ currentPlan , setCurrentPlan ] = useState ( MID_PLAN_SITES )
22
22
23
- return isOpen ?
24
- < Modal
25
- title = ""
26
- onRequestClose = { ( ) => setIsOpen ( false ) }
27
- className = "code-snippets-upgrade-dialog"
28
- >
29
- < h1 className = "logo" >
30
- < img src = { `${ window . CODE_SNIPPETS ?. pluginUrl } /assets/icon.svg` } alt = "" />
31
- { __ ( 'Code Snippets Pro' , 'code-snippets' ) }
32
- </ h1 >
33
- < p > { __ ( 'You are using the free version of Code Snippets.' , 'code-snippets' ) } </ p >
34
- < p > { __ ( 'Upgrade to Code Snippets Pro to unlock amazing features, including:' , 'code-snippets' ) }
35
- < ul >
36
- < li > { __ ( 'CSS stylesheet snippets' , 'code-snippets' ) } </ li >
37
- < li > { __ ( 'JavaScript snippets' , 'code-snippets' ) } </ li >
38
- < li > { __ ( 'Specialised Elementor widgets' , 'code-snippets' ) } </ li >
39
- < li > { __ ( 'Integration with block editor' , 'code-snippets' ) } </ li >
40
- < li > { __ ( 'WP-CLI snippet commands' , 'code-snippets' ) } </ li >
41
- </ ul >
42
- { __ ( '… and more!' , 'code-snippets' ) }
43
- </ p >
23
+ return (
24
+ < >
25
+ < p > < strong > { __ ( 'How many websites do you plan to use Code Snippets on?' , 'code-snippets' ) } </ strong > </ p >
26
+ < p > { __ ( 'We offer three distinct plans, each tailored to meet your needs.' , 'code-snippets' ) } </ p >
44
27
45
28
< p className = "upgrade-plans" >
46
29
{ Object . keys ( upgradePlanCosts ) . map ( planSites =>
@@ -68,6 +51,87 @@ export const UpgradeDialog: React.FC<UpgradeDialogProps> = ({ isOpen, setIsOpen
68
51
{ __ ( 'Upgrade Now' , 'code-snippets' ) }
69
52
</ ExternalLink >
70
53
</ p >
54
+ </ >
55
+ )
56
+ }
57
+
58
+ interface UpgradeInfoProps {
59
+ nextTab : VoidFunction
60
+ }
61
+
62
+ const UpgradeInfo : React . FC < UpgradeInfoProps > = ( { nextTab } ) =>
63
+ < >
64
+ < p > { __ ( 'You are using the free version of Code Snippets.' , 'code-snippets' ) } </ p >
65
+ < p > { __ ( 'Upgrade to Code Snippets Pro to unleash its full potential:' , 'code-snippets' ) }
66
+ < ul >
67
+ < li >
68
+ < strong > { __ ( 'CSS stylesheet snippets: ' , 'code-snippets' ) } </ strong >
69
+ { __ ( 'Craft impeccable websites with advanced CSS snippets.' , 'code-snippets' ) }
70
+ </ li >
71
+ < li >
72
+ < strong > { __ ( 'JavaScript snippets: ' , 'code-snippets' ) } </ strong >
73
+ { __ ( 'Enhance user interaction with the power of JavaScript.' , 'code-snippets' ) }
74
+ </ li >
75
+ < li >
76
+ < strong > { __ ( 'Specialized Elementor widgets: ' , 'code-snippets' ) } </ strong >
77
+ { __ ( 'Easily customize your site with Elementor widgets.' , 'code-snippets' ) }
78
+ </ li >
79
+ < li >
80
+ < strong > { __ ( 'Integration with block editor: ' , 'code-snippets' ) } </ strong >
81
+ { __ ( 'Seamlessly incorporate your snippets within the block editor.' , 'code-snippets' ) }
82
+ </ li >
83
+ < li >
84
+ < strong > { __ ( 'WP-CLI snippet commands: ' , 'code-snippets' ) } </ strong >
85
+ { __ ( 'Access and control your snippets directly from the command line.' , 'code-snippets' ) }
86
+ </ li >
87
+ < li >
88
+ < strong > { __ ( 'Premium support: ' , 'code-snippets' ) } </ strong >
89
+ { __ ( "Direct access to our team. We're happy to help!" , 'code-snippets' ) }
90
+ </ li >
91
+ </ ul >
92
+
93
+ { __ ( '… and more!' , 'code-snippets' ) }
94
+ </ p >
95
+
96
+ < p className = "action-buttons" >
97
+ < ExternalLink
98
+ className = "button button-secondary"
99
+ href = "https://codesnippets.pro/pricing/"
100
+ >
101
+ { __ ( 'Learn More' , 'code-snippets' ) }
102
+ </ ExternalLink >
103
+
104
+ < button
105
+ className = "button button-primary button-large"
106
+ onClick = { nextTab }
107
+ >
108
+ { __ ( 'See Plans' , 'code-snippets' ) }
109
+ < span className = "dashicons dashicons-arrow-right" > </ span >
110
+ </ button >
111
+ </ p >
112
+ </ >
113
+
114
+ export const UpgradeDialog : React . FC < UpgradeDialogProps > = ( { isOpen, setIsOpen } ) => {
115
+ const [ currentTab , setCurrentTab ] = useState ( 0 )
116
+
117
+ return isOpen ?
118
+ < Modal
119
+ title = ""
120
+ className = "code-snippets-upgrade-dialog"
121
+ onRequestClose = { ( ) => {
122
+ setIsOpen ( false )
123
+ setCurrentTab ( 0 )
124
+ } }
125
+ >
126
+ < h1 className = "logo" >
127
+ < img src = { `${ window . CODE_SNIPPETS ?. pluginUrl } /assets/icon.svg` } alt = "" />
128
+ { __ ( 'Code Snippets Pro' , 'code-snippets' ) }
129
+ </ h1 >
130
+
131
+ { 0 === currentTab ?
132
+ < UpgradeInfo nextTab = { ( ) => setCurrentTab ( 1 ) } /> :
133
+ < UpgradeDialogPlans />
134
+ }
71
135
72
136
</ Modal > :
73
137
null
0 commit comments