@@ -29,7 +29,7 @@ Add an item to cart, complete the purchase, and verify 'Thank you for your order
2929Wait for page load, accept cookies (if shown), submit form with pre-filled PIN.` ,
3030 } ,
3131 [ AppType . YOUR_APPLICATION ] : {
32- url : "https://your-project-url.com " ,
32+ url : "" ,
3333 instructions : "Your testing instructions.." ,
3434 } ,
3535} ;
@@ -38,6 +38,8 @@ const urlList = Object.entries(appTemplates).map(([key, value]) => ({
3838 type : key as AppType ,
3939} ) ) ;
4040const defaultTemplate = AppType . E_COMMERCE ;
41+ const URL_REGEX =
42+ / ^ ( h t t p s ? : \/ \/ ) ? ( w w w \. ) ? [ - a - z A - Z 0 - 9 @ : % . _ \+ ~ # = ] { 2 , 256 } \. [ a - z ] { 2 , 4 } \b ( [ - a - z A - Z 0 - 9 @ : % _ \+ . ~ # ? & / / = ] * ) $ / ;
4143
4244const HomeHeroVibe = ( ) => {
4345 const [ appUrl , setAppUrl ] = useState ( appTemplates [ defaultTemplate ] . url ) ;
@@ -111,6 +113,7 @@ const HomeHeroVibe = () => {
111113 type = "url"
112114 value = { appUrl }
113115 size = { parseSize }
116+ placeholder = "https://your-project-url.com"
114117 className = "border-none ml-1 pl-2 pr-5 py-1 bg-gray-300 dark:bg-gray-700 rounded-md max-w-[300px] sm:max-w-none"
115118 onChange = { handleUrlChange }
116119 />
@@ -133,7 +136,9 @@ const HomeHeroVibe = () => {
133136 < Button
134137 size = "lg"
135138 variant = "wopeeFlat"
136- disabled = { testingInstructions . length === 0 }
139+ disabled = {
140+ testingInstructions . length === 0 || ! URL_REGEX . test ( appUrl )
141+ }
137142 onClick = { ( ) =>
138143 setLoginDialogState ( { isOpen : true , mode : "vibe" } )
139144 }
0 commit comments