Skip to content

Commit

Permalink
Refactor FooterLayout component and add ChatWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
hasanshahriar32 committed Oct 14, 2024
1 parent 991264d commit c7eabb6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/global/Footer/FooterLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { PortableTextBlock } from 'next-sanity'
import { CustomPortableText } from '@/components//shared/CustomPortableText'
import type { SettingsPayload } from '@/types'
import GTranslate from './gTranslate'
import ChatWidget from '@/components/shared/ChatWidget'

interface FooterProps {
data: SettingsPayload
Expand All @@ -20,6 +21,7 @@ export default function Footer(props: FooterProps) {
)}
<div className="flex w-full flex-row flex-wrap items-center justify-center">
<GTranslate />
<ChatWidget />
</div>
</footer>
)
Expand Down
25 changes: 25 additions & 0 deletions components/shared/ChatWidget.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use client"
import React from 'react';
import { Helmet } from "react-helmet";

const ChatWidget = () => {
return (
<Helmet>
<script type="text/javascript">
{`
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/670cad732480f5b4f58d0237/1ia4ob34l';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
`}
</script>
</Helmet>
)
};

export default ChatWidget;

0 comments on commit c7eabb6

Please sign in to comment.