Merge remote-tracking branch 'origin' into org-settings

This commit is contained in:
Tuan Dang
2023-06-27 15:39:51 +07:00
10 changed files with 53 additions and 141 deletions
+1
View File
@@ -1,5 +1,6 @@
ARG POSTHOG_HOST=https://app.posthog.com
ARG POSTHOG_API_KEY=posthog-api-key
ARG INTERCOM_ID=intercom-id
FROM node:16-alpine AS deps
# Install dependencies only when needed. Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
@@ -54,6 +54,7 @@ export const load = () => {
// Initializes Intercom
export const boot = (options = {}) => {
console.log("boot", { app_id: APP_ID, ...options })
window &&
window.Intercom &&
window.Intercom("boot", { app_id: APP_ID, ...options });
@@ -1,6 +1,8 @@
import { useEffect } from "react";
import { useRouter } from "next/router";
import { useUser } from "@app/context";
import {
boot as bootIntercom,
load as loadIntercom,
@@ -9,11 +11,12 @@ import {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const IntercomProvider = ({ children }: { children: any }) => {
const { user } = useUser();
const router = useRouter();
if (typeof window !== "undefined") {
loadIntercom();
bootIntercom();
bootIntercom({name: `${user?.firstName || ""} ${user?.lastName || ""}`, email: user?.email || "", created_at: Math.floor(((new Date(user?.createdAt))?.getTime() || 0) / 1000)});
}
useEffect(() => {
+1 -1
View File
@@ -168,7 +168,7 @@ export default function Home() {
icon: faHandPeace,
time: "3 min",
userAction: "intro_cta_clicked",
link: "https://www.youtube.com/watch?v=3F7FNYX94zA"
link: "https://www.youtube.com/watch?v=PK23097-25I"
})}
{learningItem({
text: "Add your secrets",