diff --git a/apps/demo/pages/app/index.tsx b/apps/demo/pages/app/index.tsx index 6d3912c6b5..407e00d7b1 100644 --- a/apps/demo/pages/app/index.tsx +++ b/apps/demo/pages/app/index.tsx @@ -1,191 +1,210 @@ -import fbsetup from "../../public/fb-setup.png"; import formbricks from "@formbricks/js"; import Image from "next/image"; +import { useEffect, useState } from "react"; +import fbsetup from "../../public/fb-setup.png"; + export default function AppPage({}) { + const [darkMode, setDarkMode] = useState(false); + + useEffect(() => { + if (darkMode) { + document.body.classList.add('dark'); + } else { + document.body.classList.remove('dark'); + } + }, [darkMode]); + return ( -
- This app helps you test your in-app surveys. You can create an test user actions, create and update - user attributes, etc. -
++ This app helps you test your in-app surveys. You can create and test user actions, create and update + user attributes, etc. +
++
Copy the environment ID of your Formbricks app to the env variable in demo/.env
- Look at the logs to understand how the widget works. Open your browser console{" "} - to see the logs. +
+ Look at the logs to understand how the widget works. Open your browser console to see the logs.
- {/*- On formbricks.logout() a few things happen: New person is created and{" "} - surveys & no-code actions are pulled from Formbricks:. -
- -- If you made a change in Formbricks app and it does not seem to work, hit 'Logout' and - try again. -
-+ On formbricks.logout() a few things happen: New person is created and{" "} + surveys & no-code actions are pulled from Formbricks:. +
+ ++ If you made a change in Formbricks app and it does not seem to work, hit 'Logout' and try again. +
+- This button sends a{" "} - - Code Action - {" "} - to the Formbricks API called 'Code Action'. You will find it in the Actions Tab. -
-- This button sends a{" "} - - No Code Action - {" "} - as long as you created it beforehand in the Formbricks App.{" "} - - Here are instructions on how to do it. - -
-- This button sets the{" "} - - attribute - {" "} - 'Plan' to 'Free'. If the attribute does not exist, it creates it. -
-- This button sets the{" "} - - attribute - {" "} - 'Plan' to 'Paid'. If the attribute does not exist, it creates it. -
-- This button sets the{" "} - - user email - {" "} - 'test@web.com' -
-- This button sets an external{" "} - - user ID - {" "} - to 'THIS-IS-A-VERY-LONG-USER-ID-FOR-TESTING' -
-+ This button sends a{" "} + + Code Action + {" "} + to the Formbricks API called 'Code Action'. You will find it in the Actions Tab. +
++ This button sends a{" "} + + No Code Action + {" "} + as long as you created it beforehand in the Formbricks App.{" "} + + Here are instructions on how to do it. + +
++ This button sets the{" "} + + attribute + {" "} + 'Plan' to 'Free'. If the attribute does not exist, it creates it. +
++ This button sets the{" "} + + attribute + {" "} + 'Plan' to 'Paid'. If the attribute does not exist, it creates it. +
++ This button sets the{" "} + + user email + {" "} + 'test@web.com' +
++ This button sets an external{" "} + + user ID + {" "} + to 'THIS-IS-A-VERY-LONG-USER-ID-FOR-TESTING' +
+