1
0
mirror of https://github.com/uetchy/namae.git synced 2025-09-10 01:56:38 +09:00

feat: add sentry

This commit is contained in:
2019-09-24 13:55:07 +09:00
parent 85520b2417
commit b56fd7fbbe
7 changed files with 141 additions and 46 deletions

View File

@@ -1,7 +1,8 @@
import React, {useState} from 'react';
import React, {useState, useEffect} from 'react';
import styled, {createGlobalStyle} from 'styled-components';
import {Helmet} from 'react-helmet';
import {useTranslation} from 'react-i18next';
import {initGA, sendQueryStatistics} from './util/analytics';
import Welcome from './components/Welcome';
import Form from './components/Form';
@@ -15,8 +16,13 @@ export default function App() {
const [query, setQuery] = useState('');
const {t} = useTranslation();
useEffect(() => {
initGA();
}, []);
function onQuery(query: string) {
setQuery(query);
sendQueryStatistics(query.length);
}
return (