Skip to content

Commit 664e4aa

Browse files
committed
update demo form
1 parent 4dd1177 commit 664e4aa

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

reflex_ui/blocks/demo_form.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222

2323
demo_form_error_message = ClientStateVar.create("demo_form_error_message", "")
2424
is_sending_demo_form = ClientStateVar.create("is_sending_demo_form", False)
25+
demo_form_open_cs = ClientStateVar.create("demo_form_open", False)
2526

2627
COMMONROOM_DESTINATION_ID = os.getenv("COMMONROOM_DESTINATION_ID", "")
2728
COMMONROOM_API_TOKEN = os.getenv("COMMONROOM_API_TOKEN", "")
2829
CAL_REQUEST_DEMO_URL = os.getenv(
2930
"CAL_REQUEST_DEMO_URL", "https://cal.com/team/reflex/reflex-intro-call"
3031
)
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")
3433
INTRO_CAL_URL = os.getenv("INTRO_CAL_URL", "https://cal.com/team/reflex/reflex-intro")
3534
CAL_ENTERPRISE_FOLLOW_UP_URL = os.getenv(
3635
"CAL_ENTERPRISE_FOLLOW_UP_URL",
@@ -167,8 +166,8 @@ def select_field(
167166

168167

169168
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"]
172171

173172

174173
def check_if_company_email(email: str) -> bool:
@@ -298,10 +297,10 @@ async def on_submit(self, form_data: dict[str, Any]):
298297

299298
# Route based on company size and technical level
300299
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
302301
cal_url = JH_CAL_URL
303302
else:
304-
# Large companies (>10 employees)
303+
# Large companies (more than 5 employees)
305304
if technical_level == "Non-technical":
306305
cal_url = JH_CAL_URL
307306
else: # Neutral or Technical
@@ -508,7 +507,7 @@ def demo_form(**props) -> rx.Component:
508507
)
509508

510509

511-
def demo_form_dialog(trigger: rx.Component, **props) -> rx.Component:
510+
def demo_form_dialog(trigger: rx.Component | None, **props) -> rx.Component:
512511
"""Return a demo form dialog container element.
513512
514513
Args:
@@ -546,6 +545,8 @@ def demo_form_dialog(trigger: rx.Component, **props) -> rx.Component:
546545
class_name="h-fit mt-1 overflow-hidden w-full max-w-md",
547546
),
548547
),
548+
open=demo_form_open_cs.value,
549+
on_open_change=demo_form_open_cs.set_value,
549550
class_name=class_name,
550551
**props,
551552
)

0 commit comments

Comments
 (0)