Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

displaying intergram chat only on the 'Contact us' page

Blue Mouse589ccd36c272
diff --git a/public/index.html b/public/index.html
index 8c07bbdc0..3be4a4067 100644
--- a/public/index.html
+++ b/public/index.html
@@ -44,7 +44,7 @@
</div>
</div>
<div id="root"></div>
- <div id="intergramPlaceholder" class="flex sticky bottom-0 self-end items-end justify-end h-0 z-50" />
+ <div id="intergramPlaceholder" class="hidden sticky bottom-0 self-end items-end justify-end h-0 z-50" />
<script>
if ('%REACT_APP_SELFHOSTED%' !== 'true') {
window.intergramId = '380259923'
diff --git a/src/pages/Contact/index.tsx b/src/pages/Contact/index.tsx
index b95b9f0e5..78dc58da8 100644
--- a/src/pages/Contact/index.tsx
+++ b/src/pages/Contact/index.tsx
@@ -1,5 +1,5 @@
/* eslint-disable jsx-a11y/anchor-has-content */
-import React from 'react'
+import React, { useEffect } from 'react'
import { useTranslation, Trans } from 'react-i18next'
import {
@@ -12,6 +12,22 @@ const Contact = (): JSX.Element => {
t: (key: string) => string
} = useTranslation('common')
+ useEffect(() => {
+ const intergram = document.querySelector('#intergramPlaceholder')
+
+ if (!intergram) {
+ return
+ }
+
+ intergram.classList.remove('hidden')
+ intergram.classList.add('flex')
+
+ return () => {
+ intergram.classList.remove('flex')
+ intergram.classList.add('hidden')
+ }
+ }, [])
+
return (
<Title title={t('titles.contact')}>
<div className='min-h-min-footer bg-gray-50 dark:bg-slate-900'>