File tree Expand file tree Collapse file tree 7 files changed +12
-53
lines changed
Expand file tree Collapse file tree 7 files changed +12
-53
lines changed Original file line number Diff line number Diff line change 1+ import os
2+
13# pcweb constants.
24API_BASE_URL_LOOPS : str = "https://app.loops.so/api/v1"
35REFLEX_DEV_WEB_LANDING_FORM_URL_GET_DEMO : str = "https://cal.com/forms/f87bd9b2-b339-4915-b4d4-0098e2db4394"
46REFLEX_DEV_WEB_LANDING_FORM_SALES_CALL_WEBHOOK_URL : str = "https://hooks.zapier.com/hooks/catch/20661176/2s1nxp9/"
57
68REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL : str = "https://hkdk.events/t0qopjbznnp2fr"
7- REFLEX_DEV_WEB_PRICING_FORM_PRO_PLAN_WAITLIST_WEBHOOK_URL : str = "https://hkdk.events/amh01aq0hojled"
8- REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL : str = "https://hkdk.events/8woee5brmxqwdr"
9+ REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL : str = os .environ .get ("REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL" )
910
1011# pcweb urls.
1112REFLEX_URL = "https://reflex.dev/"
Original file line number Diff line number Diff line change 1- import httpx
21import reflex as rx
3- from httpx import Response
4-
5- from pcweb .constants import REFLEX_DEV_WEB_PRICING_FORM_PRO_PLAN_WAITLIST_WEBHOOK_URL
6-
2+
73
84class WaitlistState (rx .State ):
95
106 loading = False
117 success = False
128
13- @rx .event
14- async def submit_pro_waitlist (self , form_data : dict ):
15- self .loading = True
16- yield
17-
18- try :
19- with httpx .Client () as client :
20- response : Response = client .post (
21- REFLEX_DEV_WEB_PRICING_FORM_PRO_PLAN_WAITLIST_WEBHOOK_URL ,
22- json = form_data ,
23- )
24- response .raise_for_status ()
25-
26- self .success = True
27- yield rx .toast .success ("Thank you for joining the waitlist!" )
28-
29- except httpx .HTTPError :
30- yield rx .toast .error ("Failed to submit request. Please try again later." )
31-
32- self .loading = False
339
3410def waitlist ():
3511 return rx .box (
@@ -72,7 +48,6 @@ def waitlist():
7248 ),
7349 align_items = "center" ,
7450 )),
75- on_submit = WaitlistState .submit_pro_waitlist ,
7651 class_name = "flex lg:flex-row flex-col gap-2 justify-center items-center" ,
7752 ),
7853 class_name = "flex flex-col items-center max-w-[40rem]bg-slate-1 self-center w-full" ,
Original file line number Diff line number Diff line change 11import reflex as rx
22from pcweb .components .button import button
3-
3+ from pcweb . constants import REFLEX_DEV_WEB_LANDING_FORM_URL_GET_DEMO
44
55def glow () -> rx .Component :
66 return rx .box (
@@ -34,7 +34,7 @@ def sales_button() -> rx.Component:
3434 variant = "secondary" ,
3535 class_name = "!text-slate-11 !font-semibold !text-sm" ,
3636 ),
37- href = "/sales" ,
37+ href = REFLEX_DEV_WEB_LANDING_FORM_URL_GET_DEMO ,
3838 is_external = True ,
3939 class_name = "self-center relative" ,
4040 )
Original file line number Diff line number Diff line change 11import reflex as rx
22from pcweb .components .new_button import button
3- from pcweb .constants import REFLEX_CLOUD_URL
3+ from pcweb .constants import REFLEX_DEV_WEB_LANDING_FORM_URL_GET_DEMO
44
55
66def radial_circle (violet : bool = False ) -> rx .Component :
@@ -168,7 +168,7 @@ def card(
168168 size = "lg" ,
169169 class_name = "w-full" ,
170170 ),
171- href = ( REFLEX_CLOUD_URL if button_text != "Contact sales" else "/sales" ) ,
171+ href = REFLEX_DEV_WEB_LANDING_FORM_URL_GET_DEMO ,
172172 is_external = True ,
173173 underline = "none" ,
174174 ),
@@ -216,7 +216,7 @@ def popular_card(
216216 size = "lg" ,
217217 class_name = "w-full !text-sm !font-semibold" ,
218218 ),
219- href = f" { REFLEX_CLOUD_URL } /?redirect_url= { REFLEX_CLOUD_URL } /billing/" ,
219+ href = REFLEX_DEV_WEB_LANDING_FORM_URL_GET_DEMO ,
220220 is_external = True ,
221221 underline = "none" ,
222222 ),
Original file line number Diff line number Diff line change 11import reflex as rx
22from pcweb .components .button import button
3- from pcweb .constants import REFLEX_CLOUD_URL
3+ from pcweb .constants import REFLEX_DEV_WEB_LANDING_FORM_URL_GET_DEMO
44
55# Constants for styling
66STYLES = {
@@ -121,7 +121,7 @@ def create_action_button(
121121 variant = variant ,
122122 class_name = f"{ STYLES ['button_base' ]} { extra_styles } " ,
123123 ),
124- href = REFLEX_CLOUD_URL if text != "Contact sales" else "/sales" ,
124+ href = REFLEX_DEV_WEB_LANDING_FORM_URL_GET_DEMO ,
125125 is_external = True ,
126126 underline = "none" ,
127127 class_name = "w-full flex justify-center items-center" ,
Original file line number Diff line number Diff line change 66from pcweb .components .webpage .comps import h1_title
77from pcweb .constants import (
88 REFLEX_DEV_WEB_LANDING_FORM_SALES_CALL_WEBHOOK_URL ,
9- REFLEX_DEV_WEB_PRICING_FORM_PRO_PLAN_WAITLIST_WEBHOOK_URL ,
109)
1110from pcweb .pages .docs import getting_started , hosting
1211from pcweb .templates .webpage import webpage
@@ -38,22 +37,6 @@ async def submit(self, form_data: dict):
3837 self .email_sent = False
3938 yield rx .toast .error ("Failed to submit request. Please try again later." )
4039
41- @rx .event
42- async def submit_pro_waitlist (self , form_data : dict ):
43- try :
44- with httpx .Client () as client :
45- response : Response = client .post (
46- REFLEX_DEV_WEB_PRICING_FORM_PRO_PLAN_WAITLIST_WEBHOOK_URL ,
47- json = form_data ,
48- )
49- response .raise_for_status ()
50-
51- yield rx .toast .success ("Thank you for joining the waitlist!" )
52-
53- except httpx .HTTPError :
54- yield rx .toast .error ("Failed to submit request. Please try again later." )
55-
56-
5740def dialog (trigger : rx .Component , content : rx .Component ) -> rx .Component :
5841 return rx .dialog .root (
5942 rx .dialog .trigger (
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def handle_submit(self, form_data: dict):
4242 json = form_data ,
4343 )
4444
45- discord_webhook_url : str | None = os . environ . get ( "DISCORD_WEBHOOK_URL" )
45+ discord_webhook_url : str | None = REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL
4646 email : str = form_data .get ("email" , "" )
4747 discord_message = f"""
4848Contact: { email }
You can’t perform that action at this time.
0 commit comments