1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-20 09:58:13 +09:00

feat: add crisp (#7)

* feat: add crisp

* test: add codacy

* fix: coverage
This commit is contained in:
2019-10-24 12:55:09 +09:00
committed by GitHub
parent 664801205c
commit 2fc4d94779
11 changed files with 706 additions and 7 deletions

View File

@@ -1,13 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import * as serviceWorker from './serviceWorker';
import {FullScreenSuspense} from './util/suspense';
import {initGA, initSentry} from './util/analytics';
import {initCrisp} from './util/crip';
import './util/i18n';
initGA();
initSentry();
initCrisp();
ReactDOM.render(
<FullScreenSuspense>

14
web/src/util/crip.ts Normal file
View File

@@ -0,0 +1,14 @@
interface CrispWindow extends Window {
$crisp: any[];
CRISP_WEBSITE_ID: string;
}
declare var window: CrispWindow;
export function initCrisp() {
window.$crisp = [];
window.CRISP_WEBSITE_ID = '92b2e096-6892-47dc-bf4a-057bad52d82e';
const s = document.createElement('script');
s.src = 'https://client.crisp.chat/l.js';
s.async = true;
document.getElementsByTagName('head')[0].appendChild(s);
}