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 ( -
-
-

Formbricks In-product Survey Demo App

-

- This app helps you test your in-app surveys. You can create an test user actions, create and update - user attributes, etc. -

+
+
+
+

Formbricks In-product Survey Demo App

+

+ This app helps you test your in-app surveys. You can create and test user actions, create and update + user attributes, etc. +

+
+
+
-
-

Setup .env

-

+

+

Setup .env

+

Copy the environment ID of your Formbricks app to the env variable in demo/.env

fb setup
-
-

Widget Logs

-

- Look at the logs to understand how the widget works. Open your browser console{" "} - to see the logs. +

+

Widget Logs

+

+ Look at the logs to understand how the widget works. Open your browser console to see the logs.

- {/*
+ {/*
*/}
-
-

Reset person / pull data from Formbricks app

-

- 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. -

-
+
+

+ Reset person / pull data from Formbricks app +

+

+ 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' +

+
+
+
+
+
+ ); } diff --git a/apps/demo/tailwind.config.js b/apps/demo/tailwind.config.js index fa51e9f4b3..0ccb1b5185 100644 --- a/apps/demo/tailwind.config.js +++ b/apps/demo/tailwind.config.js @@ -5,6 +5,7 @@ module.exports = { "./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}", ], + darkMode: "class", theme: { extend: {}, },