77from reflex_ui .blocks .demo_form import demo_form_dialog
88
99from pcweb .components .hosting_banner import HostingBannerState
10+ from pcweb .components .number_flow import number_flow
1011from pcweb .constants import PRO_TIERS_TABLE , REFLEX_BUILD_URL , REFLEX_CLOUD_URL
12+ from pcweb .pages .pricing .enable_tiers_state import EnableTiersState
13+ from pcweb .pages .pricing .enterprise_demo_form import book_a_demo_form
1114
1215YEARLY_MONTHS_FREE = 2 # 2 months free
1316YEARLY_DISCOUNT_MULTIPLIER = (12 - YEARLY_MONTHS_FREE ) / 12
@@ -198,43 +201,46 @@ def pricing_cards() -> rx.Component:
198201 target = "_blank" ,
199202 ),
200203 ),
201- # card(
202- # "Pro",
203- # number_flow(
204- # value=rx.cond(
205- # monthly_yearly_toggle_cs.value == "monthly",
206- # ProTierState.selected_tier["price"],
207- # round(
208- # ProTierState.selected_tier["price"]
209- # * YEARLY_DISCOUNT_MULTIPLIER,
210- # 1,
211- # ),
212- # ),
213- # trend="0",
214- # prefix="$",
215- # suffix=" /monthly",
216- # class_name="text-3xl text-secondary-12 font-semibold py-4",
217- # ),
218- # "Build, deploy and scale your apps.",
219- # [
220- # Feature("TokenCircleIcon", "", pro_tiers_select()),
221- # Feature("SquareLock02Icon", "Private Projects"),
222- # Feature("CursorInWindowIcon", "Full-Fledged Browser IDE"),
223- # Feature("PlugSocketIcon", "Integrations"),
224- # Feature("GithubIcon", "Connect to Github"),
225- # Feature("Globe02Icon", "Custom Domains"),
226- # Feature("CpuIcon", "Up to 8 GB RAM / 4 vCPU per deployed app"),
227- # ],
228- # ui.button(
229- # "Start with Pro plan",
230- # variant="secondary",
231- # size="lg",
232- # class_name="w-full font-semibold",
233- # on_click=ProTierState.redirect_to_billing(
234- # monthly_yearly_toggle_cs.value == "yearly"
235- # ),
236- # ),
237- # ),
204+ rx .cond (
205+ EnableTiersState .enable_pro_tier ,
206+ card (
207+ "Pro" ,
208+ number_flow (
209+ value = rx .cond (
210+ monthly_yearly_toggle_cs .value == "monthly" ,
211+ ProTierState .selected_tier ["price" ],
212+ round (
213+ ProTierState .selected_tier ["price" ]
214+ * YEARLY_DISCOUNT_MULTIPLIER ,
215+ 1 ,
216+ ),
217+ ),
218+ trend = "0" ,
219+ prefix = "$" ,
220+ suffix = " /monthly" ,
221+ class_name = "text-3xl text-secondary-12 font-semibold py-4" ,
222+ ),
223+ "Build, deploy and scale your apps." ,
224+ [
225+ Feature ("TokenCircleIcon" , "" , pro_tiers_select ()),
226+ Feature ("SquareLock02Icon" , "Private Projects" ),
227+ Feature ("CursorInWindowIcon" , "Full-Fledged Browser IDE" ),
228+ Feature ("PlugSocketIcon" , "Integrations" ),
229+ Feature ("GithubIcon" , "Connect to Github" ),
230+ Feature ("Globe02Icon" , "Custom Domains" ),
231+ Feature ("CpuIcon" , "Up to 8 GB RAM / 4 vCPU per deployed app" ),
232+ ],
233+ ui .button (
234+ "Start with Pro plan" ,
235+ variant = "secondary" ,
236+ size = "lg" ,
237+ class_name = "w-full font-semibold" ,
238+ on_click = ProTierState .redirect_to_billing (
239+ monthly_yearly_toggle_cs .value == "yearly"
240+ ),
241+ ),
242+ ),
243+ ),
238244 popular_card (
239245 "Enterprise" ,
240246 "Custom" ,
@@ -262,7 +268,12 @@ def pricing_cards() -> rx.Component:
262268 ),
263269 ),
264270 ),
265- class_name = "grid grid-cols-1 xl:grid-cols-2 gap-4 w-full xl:w-auto mx-auto justify-items-center" ,
271+ class_name = ui .cn (
272+ "grid grid-cols-1 xl:grid-cols-2 gap-4 w-full xl:w-auto mx-auto justify-items-center" ,
273+ rx .cond (
274+ EnableTiersState .enable_pro_tier , "xl:grid-cols-3" , "xl:grid-cols-2"
275+ ),
276+ ),
266277 )
267278
268279
@@ -305,7 +316,10 @@ def monthly_yearly_toggle():
305316
306317def plan_cards ():
307318 return rx .box (
308- header (),
319+ rx .cond (
320+ EnableTiersState .enable_free_tier ,
321+ header (),
322+ ),
309323 # monthly_yearly_toggle(),
310324 rx .el .style (
311325 """
@@ -317,7 +331,11 @@ def plan_cards():
317331 }
318332 """
319333 ),
320- pricing_cards (),
334+ rx .cond (
335+ EnableTiersState .enable_free_tier ,
336+ pricing_cards (),
337+ book_a_demo_form (),
338+ ),
321339 class_name = (
322340 "flex flex-col w-full justify-center items-center max-w-[85rem] mx-auto" ,
323341 rx .cond (
0 commit comments