|
22 | 22 |
|
23 | 23 | demo_form_error_message = ClientStateVar.create("demo_form_error_message", "") |
24 | 24 | is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False) |
| 25 | +demo_form_open_cs = ClientStateVar.create("demo_form_open", False) |
25 | 26 |
|
26 | 27 | COMMONROOM_DESTINATION_ID = os.getenv("COMMONROOM_DESTINATION_ID", "") |
27 | 28 | COMMONROOM_API_TOKEN = os.getenv("COMMONROOM_API_TOKEN", "") |
28 | 29 | CAL_REQUEST_DEMO_URL = os.getenv( |
29 | 30 | "CAL_REQUEST_DEMO_URL", "https://cal.com/team/reflex/reflex-intro-call" |
30 | 31 | ) |
31 | | -JH_CAL_URL = os.getenv( |
32 | | - "JH_CAL_URL", "https://cal.com/team/reflex/reflex-demo-with-jh-tevis" |
33 | | -) |
| 32 | +JH_CAL_URL = os.getenv("JH_CAL_URL", "https://cal.com/team/reflex/demo-with-reflex") |
34 | 33 | INTRO_CAL_URL = os.getenv("INTRO_CAL_URL", "https://cal.com/team/reflex/reflex-intro") |
35 | 34 | CAL_ENTERPRISE_FOLLOW_UP_URL = os.getenv( |
36 | 35 | "CAL_ENTERPRISE_FOLLOW_UP_URL", |
@@ -167,8 +166,8 @@ def select_field( |
167 | 166 |
|
168 | 167 |
|
169 | 168 | def is_small_company(num_employees: str) -> bool: |
170 | | - """Check if company has 10 or fewer employees.""" |
171 | | - return num_employees in ["1", "2-5", "6-10"] |
| 169 | + """Check if company up to 5 employees.""" |
| 170 | + return num_employees in ["1", "2-5"] |
172 | 171 |
|
173 | 172 |
|
174 | 173 | def check_if_company_email(email: str) -> bool: |
@@ -298,10 +297,10 @@ async def on_submit(self, form_data: dict[str, Any]): |
298 | 297 |
|
299 | 298 | # Route based on company size and technical level |
300 | 299 | if is_small_company(form_data.get("number_of_employees", "")): |
301 | | - # Small companies (≤10 employees) always go to JH_CAL_URL |
| 300 | + # Small companies (up to 5 employees) always go to JH_CAL_URL |
302 | 301 | cal_url = JH_CAL_URL |
303 | 302 | else: |
304 | | - # Large companies (>10 employees) |
| 303 | + # Large companies (more than 5 employees) |
305 | 304 | if technical_level == "Non-technical": |
306 | 305 | cal_url = JH_CAL_URL |
307 | 306 | else: # Neutral or Technical |
@@ -508,7 +507,7 @@ def demo_form(**props) -> rx.Component: |
508 | 507 | ) |
509 | 508 |
|
510 | 509 |
|
511 | | -def demo_form_dialog(trigger: rx.Component, **props) -> rx.Component: |
| 510 | +def demo_form_dialog(trigger: rx.Component | None, **props) -> rx.Component: |
512 | 511 | """Return a demo form dialog container element. |
513 | 512 |
|
514 | 513 | Args: |
@@ -546,6 +545,8 @@ def demo_form_dialog(trigger: rx.Component, **props) -> rx.Component: |
546 | 545 | class_name="h-fit mt-1 overflow-hidden w-full max-w-md", |
547 | 546 | ), |
548 | 547 | ), |
| 548 | + open=demo_form_open_cs.value, |
| 549 | + on_open_change=demo_form_open_cs.set_value, |
549 | 550 | class_name=class_name, |
550 | 551 | **props, |
551 | 552 | ) |
0 commit comments