feat: add Intelliticks chat widget
This commit is contained in:
parent
a1c0ba2e51
commit
294ae759b4
3 changed files with 38 additions and 1 deletions
|
|
@ -40,6 +40,8 @@ export const metadata = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
import Chat from "@/components/Chat";
|
||||||
|
|
||||||
const TopProgressBar = dynamic(() => import("@/components/TopProgressbar"), {
|
const TopProgressBar = dynamic(() => import("@/components/TopProgressbar"), {
|
||||||
ssr: false,
|
ssr: false,
|
||||||
});
|
});
|
||||||
|
|
@ -54,6 +56,7 @@ export default function RootLayout({ children }) {
|
||||||
<TopProgressBar />
|
<TopProgressBar />
|
||||||
<Navbar />
|
<Navbar />
|
||||||
{children}
|
{children}
|
||||||
|
<Chat />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ export const metadata = {
|
||||||
export default function Layout({ children }) {
|
export default function Layout({ children }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
||||||
{children}
|
{children}
|
||||||
<Footer />
|
<Footer />
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
35
components/Chat.jsx
Normal file
35
components/Chat.jsx
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
// components/Intelliticks.js
|
||||||
|
"use client"
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
|
// Component for Intelliticks chat widget
|
||||||
|
const Chat = () => {
|
||||||
|
useEffect(() => {
|
||||||
|
// Paste the Intelliticks script here
|
||||||
|
(function (I, L, T, i, c, k, s) {
|
||||||
|
if (I.iticks) return;
|
||||||
|
I.iticks = { host: c, settings: s, clientId: k, cdn: L, queue: [] };
|
||||||
|
var h = T.head || T.documentElement;
|
||||||
|
var e = T.createElement(i);
|
||||||
|
var l = I.location;
|
||||||
|
e.async = true;
|
||||||
|
e.src = (L || c) + "/client/inject-v2.min.js";
|
||||||
|
h.insertBefore(e, h.firstChild);
|
||||||
|
I.iticks.call = function (a, b) {
|
||||||
|
I.iticks.queue.push([a, b]);
|
||||||
|
};
|
||||||
|
})(
|
||||||
|
window,
|
||||||
|
"https://cdn-v1.intelliticks.com/prod/common",
|
||||||
|
document,
|
||||||
|
"script",
|
||||||
|
"https://app.intelliticks.com",
|
||||||
|
"u3cWw3sDpdKexqXCY_c",
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Chat;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue