1111from pcweb .components .new_button import button
1212from pcweb .constants import CAL_REQUEST_DEMO_URL
1313from pcweb .pages .framework .views .companies import pricing_page_companies
14- from pcweb .telemetry .postog_metrics import DemoEvent , send_data_to_posthog , send_data_to_slack
14+ from pcweb .telemetry .postog_metrics import (
15+ DemoEvent ,
16+ send_data_to_posthog ,
17+ send_data_to_slack ,
18+ )
1519
1620ThankYouDialogState = ClientStateVar .create ("thank_you_dialog_state" , False )
1721
@@ -134,7 +138,7 @@ def submit(self, form_data: dict[str, Any]):
134138 linkedin_url = form_data .get ("linkedin_url" , "" ).strip ()
135139 if linkedin_url :
136140 # Basic LinkedIn URL validation
137- linkedin_pattern = r' ^https?://(www\.)?linkedin\.com/(in|company)/.+$'
141+ linkedin_pattern = r" ^https?://(www\.)?linkedin\.com/(in|company)/.+$"
138142
139143 if not re .match (linkedin_pattern , linkedin_url ):
140144 self .banned_linkedin = True
@@ -191,8 +195,10 @@ def submit(self, form_data: dict[str, Any]):
191195 # Send to PostHog for all submissions
192196 yield QuoteFormState .send_demo_event (form_data )
193197
194- yield rx .call_script (f"try {{ ko.identify('{ email } '); }} catch(e) {{ console.warn('Koala identify failed:', e); }}" )
195-
198+ yield rx .call_script (
199+ f"try {{ ko.identify('{ email } '); }} catch(e) {{ console.warn('Koala identify failed:', e); }}"
200+ )
201+
196202 if self .is_small_company ():
197203 yield ThankYouDialogState .push (True )
198204 yield rx .redirect ("/pricing?lead=1" )
@@ -209,7 +215,6 @@ def submit(self, form_data: dict[str, Any]):
209215
210216 return rx .redirect (cal_url )
211217
212-
213218 @rx .event (background = True )
214219 async def send_demo_event (self , form_data : dict [str , Any ]):
215220 first_name = form_data .get ("first_name" , "" )
@@ -227,10 +232,10 @@ async def send_demo_event(self, form_data: dict[str, Any]):
227232 referral_source = self .referral_source ,
228233 phone_number = form_data .get ("phone_number" , "" ),
229234 )
230-
235+
231236 # Send to PostHog (existing)
232237 await send_data_to_posthog (demo_event )
233-
238+
234239 # Send to Slack (new)
235240 try :
236241 await send_data_to_slack (demo_event )
@@ -347,8 +352,7 @@ def thank_you_modal() -> rx.Component:
347352 size = "icon-sm" ,
348353 type = "button" ,
349354 class_name = "focus:outline-none" ,
350- on_click = ThankYouDialogState .set_value (False )
351-
355+ on_click = ThankYouDialogState .set_value (False ),
352356 ),
353357 ),
354358 class_name = "flex flex-row items-center gap-2 justify-between w-full" ,
@@ -357,19 +361,16 @@ def thank_you_modal() -> rx.Component:
357361 "We've received your submission and our team will get back to you soon. We appreciate your interest in Reflex!" ,
358362 class_name = "text-slate-9 font-medium text-sm" ,
359363 ),
360- class_name = "flex flex-col w-full gap-y-4"
364+ class_name = "flex flex-col w-full gap-y-4" ,
361365 ),
362366 class_name = "w-full" ,
363367 on_interact_outside = ThankYouDialogState .set_value (False ),
364368 on_escape_key_down = ThankYouDialogState .set_value (False ),
365-
366369 ),
367- open = ThankYouDialogState .value
370+ open = ThankYouDialogState .value ,
368371 )
369372
370373
371-
372-
373374def custom_quote_form () -> rx .Component :
374375 """Custom quote form component with clean, maintainable structure."""
375376 return rx .box (
@@ -507,7 +508,15 @@ def custom_quote_form() -> rx.Component:
507508 select_field (
508509 "Number of employees" ,
509510 "num_employees" ,
510- ["1" , "2-5" , "6-10" , "11-50" , "51-100" , "101-500" , "500+" ], # Updated options
511+ [
512+ "1" ,
513+ "2-5" ,
514+ "6-10" ,
515+ "11-50" ,
516+ "51-100" ,
517+ "101-500" ,
518+ "500+" ,
519+ ], # Updated options
511520 "500+" ,
512521 required = True ,
513522 state_var = "num_employees" ,
@@ -541,7 +550,7 @@ def custom_quote_form() -> rx.Component:
541550 on_submit = QuoteFormState .submit ,
542551 reset_on_submit = True ,
543552 ),
544- class_name = "relative bg-slate-1 p-6 sm:p-8 rounded-2xl border-2 border-[-- violet-9] shadow-lg w-full max-w-md mx-auto lg:max-w-none lg:mx-0" ,
553+ class_name = "relative bg-slate-1 p-6 sm:p-8 rounded-2xl border-2 border-violet-9 shadow-lg w-full max-w-md mx-auto lg:max-w-none lg:mx-0" ,
545554 ),
546555 class_name = "grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-16 max-w-7xl mx-auto items-start" ,
547556 ),
0 commit comments