Skip to content

Commit

Permalink
feat(apps/faq): add mava script
Browse files Browse the repository at this point in the history
  • Loading branch information
LufyCZ committed Jan 15, 2025
1 parent 3a31376 commit 3d0ed30
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions apps/web/src/app/(cms)/faq/components/mava.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use client'

import { usePathname } from 'next/navigation'
import Script from 'next/script'

export function MavaScript() {
const pathname = usePathname()

const isFaq = pathname.startsWith('/faq')

return (
<Script
defer
strategy="lazyOnload"
src="https://widget.mava.app"
widget-version="v2"
id="MavaWebChat"
enable-sdk="false"
data-token="13a77dff2927f04aff517c51da8b35e921d69ecd86b5879ce2a7e747c71a646b"
data-hide-mava-launcher={String(isFaq)}
/>
)
}
2 changes: 2 additions & 0 deletions apps/web/src/app/(cms)/faq/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Suspense } from 'react'
import { MavaScript } from './components/mava'

export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
<MavaScript />
<Suspense>{children}</Suspense>
</>
)
Expand Down

0 comments on commit 3d0ed30

Please sign in to comment.