Setup hotjar integration

This commit is contained in:
Ariful Alam
2022-03-20 00:40:59 +06:00
parent 2951f53fc0
commit e91c8d9df0
3 changed files with 20 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
import config from '../ezprofile.config';
import colors from '../data/colors.json';
import { hotjar } from 'react-hotjar';
export const getInitialTheme = () => {
if (config.themeConfig.disableSwitch) {
@@ -85,3 +86,13 @@ export const isThemeDarkish = (theme) => {
return false;
}
};
export const setupHotjar = () => {
if (config.hotjar?.id) {
let snippetVersion = config.hotjar?.snippetVersion
? config.hotjar?.snippetVersion
: 6;
hotjar.initialize(config.hotjar.id, snippetVersion);
}
};