diff --git a/apps/api b/apps/api index 63e0ca33e9..378cbf8f3a 160000 --- a/apps/api +++ b/apps/api @@ -1 +1 @@ -Subproject commit 63e0ca33e95583a5e2aae69195af052fd0d9aef8 +Subproject commit 378cbf8f3a67ea7877296f1da02edb2b6e3efbce diff --git a/apps/web/.env.example b/apps/web/.env.example index f3eccbfd2b..63716f635f 100644 --- a/apps/web/.env.example +++ b/apps/web/.env.example @@ -99,3 +99,6 @@ CALENDSO_ENCRYPTION_KEY= # Intercom Config NEXT_PUBLIC_INTERCOM_APP_ID= + +# Zendesk Config +NEXT_PUBLIC_ZENDESK_KEY= \ No newline at end of file diff --git a/apps/web/components/Shell.tsx b/apps/web/components/Shell.tsx index 31b186da7a..2f21850fb3 100644 --- a/apps/web/components/Shell.tsx +++ b/apps/web/components/Shell.tsx @@ -19,7 +19,8 @@ import { Toaster } from "react-hot-toast"; import LicenseBanner from "@ee/components/LicenseBanner"; import TrialBanner from "@ee/components/TrialBanner"; -import HelpMenuItemDynamic from "@ee/lib/intercom/HelpMenuItemDynamic"; +import IntercomMenuItem from "@ee/lib/intercom/IntercomMenuItem"; +import ZendeskMenuItem from "@ee/lib/zendesk/ZendeskMenuItem"; import classNames from "@lib/classNames"; import { NEXT_PUBLIC_BASE_URL } from "@lib/config/constants"; @@ -459,7 +460,7 @@ function UserDropdown({ small }: { small?: boolean }) { viewBox="0 0 2447.6 2452.5" className={classNames( "text-gray-500 group-hover:text-gray-700", - "mt-0.5 h-4 w-4 flex-shrink-0 ltr:mr-2 rtl:ml-2" + "mt-0.5 h-4 w-4 flex-shrink-0 ltr:mr-4 rtl:ml-4" )} xmlns="http://www.w3.org/2000/svg"> @@ -489,7 +490,8 @@ function UserDropdown({ small }: { small?: boolean }) { {t("visit_roadmap")} - + + {children} diff --git a/apps/web/ee/lib/intercom/HelpMenuItem.tsx b/apps/web/ee/lib/intercom/HelpMenuItem.tsx deleted file mode 100644 index 92ad525bb6..0000000000 --- a/apps/web/ee/lib/intercom/HelpMenuItem.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { ChatAltIcon } from "@heroicons/react/solid"; -import { useIntercom } from "react-use-intercom"; - -import classNames from "@lib/classNames"; -import { useLocale } from "@lib/hooks/useLocale"; - -import { DropdownMenuItem } from "@components/ui/Dropdown"; - -const HelpMenuItem = () => { - const { t } = useLocale(); - const { boot, show } = useIntercom(); - return ( - - - - ); -}; - -export default HelpMenuItem; diff --git a/apps/web/ee/lib/intercom/HelpMenuItemDynamic.tsx b/apps/web/ee/lib/intercom/HelpMenuItemDynamic.tsx deleted file mode 100644 index e1bee9370f..0000000000 --- a/apps/web/ee/lib/intercom/HelpMenuItemDynamic.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import dynamic from "next/dynamic"; -import { Fragment } from "react"; - -const HelpMenuItemDynamic = process.env.NEXT_PUBLIC_INTERCOM_APP_ID - ? dynamic(() => import("./HelpMenuItem")) - : Fragment; - -export default HelpMenuItemDynamic; diff --git a/apps/web/ee/lib/intercom/IntercomMenuItem.tsx b/apps/web/ee/lib/intercom/IntercomMenuItem.tsx new file mode 100644 index 0000000000..a636713610 --- /dev/null +++ b/apps/web/ee/lib/intercom/IntercomMenuItem.tsx @@ -0,0 +1,33 @@ +import { ChatAltIcon } from "@heroicons/react/solid"; +import { useIntercom } from "react-use-intercom"; + +import classNames from "@lib/classNames"; +import { useLocale } from "@lib/hooks/useLocale"; + +import { DropdownMenuItem } from "@components/ui/Dropdown"; + +export default function IntercomMenuItem() { + const { t } = useLocale(); + const { boot, show } = useIntercom(); + if (!process.env.NEXT_PUBLIC_INTERCOM_APP_ID) return null; + else + return ( + + + + ); +} diff --git a/apps/web/ee/lib/zendesk/ZendeskMenuItem.tsx b/apps/web/ee/lib/zendesk/ZendeskMenuItem.tsx new file mode 100644 index 0000000000..0b5c7b7f42 --- /dev/null +++ b/apps/web/ee/lib/zendesk/ZendeskMenuItem.tsx @@ -0,0 +1,39 @@ +import { ChatAltIcon } from "@heroicons/react/solid"; +import Script from "next/script"; +import { useState } from "react"; + +import classNames from "@lib/classNames"; +import { useLocale } from "@lib/hooks/useLocale"; + +import { DropdownMenuItem } from "@components/ui/Dropdown"; + +const ZENDESK_KEY = process.env.NEXT_PUBLIC_ZENDESK_KEY; + +export default function ZendeskMenuItem() { + const [active, setActive] = useState(false); + const { t } = useLocale(); + + if (!process.env.NEXT_PUBLIC_ZENDESK_KEY) return null; + else + return ( + <> + + + + {active && ( +