Skip to content

Commit ce6ae21

Browse files
authored
📦 NEW: Revert crisp client setup (#157)
This reverts commit 836ace3.
1 parent 5bfca93 commit ce6ae21

File tree

5 files changed

+57
-89
lines changed

5 files changed

+57
-89
lines changed

‎apps/baseai.dev/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@headlessui/react": "^1.7.15",
1717
"@headlessui/tailwindcss": "^0.2.0",
1818
"@heroicons/react": "^2.1.3",
19+
"@intercom/messenger-js-sdk": "^0.0.14",
1920
"@mdx-js/loader": "^3.0.0",
2021
"@mdx-js/react": "^3.0.0",
2122
"@next/mdx": "^14.0.4",

‎apps/baseai.dev/src/app/layout.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Providers } from '@/app/providers';
2-
import CrispClient from '@/components/crisp';
2+
import IntercomClient from '@/components/intercom';
33
import '@/styles/tailwind.css';
44
import { Inter } from 'next/font/google';
55
const inter = Inter({ subsets: ['latin'] });
@@ -53,7 +53,7 @@ export default async function RootLayout({
5353
<html lang="en" className="h-full" suppressHydrationWarning>
5454
<body className={`${inter.className}`}>
5555
<Providers>
56-
<CrispClient />
56+
<IntercomClient />
5757
{children}
5858
</Providers>
5959
</body>

‎apps/baseai.dev/src/components/crisp.tsx‎

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
'use client';
2+
3+
import Intercom from '@intercom/messenger-js-sdk';
4+
import { useEffect } from 'react';
5+
6+
const IntercomClient = () => {
7+
useEffect(() => {
8+
// Initialize Intercom.
9+
initializeIntercom();
10+
}, []);
11+
12+
const initializeIntercom = () => {
13+
// Check if app id exists.
14+
if (!process.env.NEXT_PUBLIC_INTERCOM_APP_ID) {
15+
return;
16+
}
17+
18+
Intercom({
19+
app_id: process.env.NEXT_PUBLIC_INTERCOM_APP_ID,
20+
source: 'BaseAI',
21+
created_at: new Date().getTime(),
22+
});
23+
};
24+
25+
return <></>;
26+
};
27+
28+
export default IntercomClient;

‎pnpm-lock.yaml‎

Lines changed: 26 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)