Skip to content

Commit

Permalink
add LiveChat Global component based on tawk.to
Browse files Browse the repository at this point in the history
  • Loading branch information
bozzhik committed Jun 18, 2024
1 parent beceb55 commit be1bc1d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const SuisseIntl = localFont({

import Header from '#/Global/Header'
import Footer from '#/Global/Footer'
import LiveChat from '#/Global/LiveChat'

export const metadata: Metadata = {
title: 'Санаторий «Удельная» – оздоровление и реабилитация в Подмосковье',
Expand All @@ -53,6 +54,7 @@ export default function RootLayout({
<Footer />
</div>
</body>
<LiveChat />
</html>
)
}
23 changes: 23 additions & 0 deletions src/components/Global/LiveChat.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import NextScript from 'next/script'

export default function LiveChat() {
return (
<>
{/* <NextScript src="https://embed.tawk.to/6671d4cc981b6c56477e911b/1i0maeii7" strategy="afterInteractive" /> */}

<NextScript id="live_chat" strategy="afterInteractive">
{`
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/6671d4cc981b6c56477e911b/1i0maeii7';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
`}
</NextScript>
</>
)
}

0 comments on commit be1bc1d

Please sign in to comment.