Skip to content

Commit bfcae63

Browse files
committed
feat: Add inline Cal.com embed to demo form with Unify tracking
- Replace Cal.com redirect with inline iframe embed in dialog - Pre-fill calendar with user name, email, and notes from form - Auto-close dialog after booking confirmation - Add Unify analytics integration for user identification - Add Slack webhook notifications for demo requests - Simplify Cal.com initialization script
1 parent d2432c3 commit bfcae63

File tree

3 files changed

+748
-432
lines changed

3 files changed

+748
-432
lines changed

demo/demo/demo.py

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import reflex as rx
44

55
import reflex_ui as ui
6+
from reflex_ui.blocks.demo_form import demo_form_dialog
7+
from reflex_ui.blocks.telemetry.unify import get_unify_trackers
68

79

810
class State(rx.State):
@@ -16,45 +18,17 @@ def set_seed(self, seed: int):
1618
def index() -> rx.Component:
1719
return rx.el.div(
1820
rx.el.div(
19-
ui.tooltip(
20-
ui.button(
21-
ui.icon("SmileIcon"),
22-
"Click me",
23-
on_click=rx.toast.success(
24-
"You are cool :)",
25-
position="top-center",
26-
),
27-
),
28-
content="Seriously, click me",
21+
rx.el.h1(
22+
"Book a Demo Form Test",
23+
class_name="text-xl sm:text-2xl font-bold text-secondary-12 px-4",
2924
),
30-
ui.checkbox(
31-
label="Click me",
32-
on_checked_change=lambda value: rx.toast.success(f"Value: {value}"),
25+
demo_form_dialog(
26+
trigger=ui.button("Open Demo Form Dialog"),
3327
),
34-
ui.slider(
35-
value=State.seed,
36-
on_value_change=State.set_seed,
37-
on_value_committed=lambda value: rx.toast.success(f"Value: {value}"),
38-
class_name="max-w-xs",
39-
),
40-
ui.gradient_profile(
41-
seed=State.seed,
42-
class_name="size-10",
43-
),
44-
ui.switch(
45-
on_checked_change=lambda value: rx.toast.success(f"Value: {value}"),
46-
),
47-
ui.select(
48-
items=[f"Item {i}" for i in range(1, 11)],
49-
name="select",
50-
default_value="Select an item",
51-
on_value_change=lambda value: rx.toast.success(f"Value: {value}"),
52-
on_open_change=lambda value: rx.toast.success(f"Open: {value}"),
53-
),
54-
class_name="flex flex-col gap-y-6 justify-center items-center",
28+
class_name="flex flex-col gap-y-4 sm:gap-y-6 justify-center items-center py-6 sm:py-12 w-full",
5529
),
56-
ui.theme_switcher(class_name="absolute top-4 right-4"),
57-
class_name="flex flex-row gap-16 justify-center items-center h-screen bg-secondary-1 relative",
30+
ui.theme_switcher(class_name="absolute top-4 right-4 z-10"),
31+
class_name="flex flex-col justify-center items-center min-h-screen bg-secondary-1 relative",
5832
)
5933

6034

@@ -78,6 +52,8 @@ def index() -> rx.Component:
7852
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:[email protected]&display=swap",
7953
rel="stylesheet",
8054
),
55+
# Unify tracking script
56+
get_unify_trackers(),
8157
],
8258
)
8359
app.add_page(index)

0 commit comments

Comments
 (0)