diff --git a/compose/neurosynth-frontend/src/App.tsx b/compose/neurosynth-frontend/src/App.tsx index 648491e8..1c46a7d9 100644 --- a/compose/neurosynth-frontend/src/App.tsx +++ b/compose/neurosynth-frontend/src/App.tsx @@ -1,82 +1,80 @@ -import Close from "@mui/icons-material/Close"; -import { IconButton } from "@mui/material"; -import { AxiosError } from "axios"; -import useGoogleAnalytics from "hooks/useGoogleAnalytics"; -import { SnackbarKey, SnackbarProvider } from "notistack"; -import { useEffect, useRef } from "react"; -import { QueryCache, QueryClient, QueryClientProvider } from "react-query"; -import Navbar from "components/Navbar/Navbar"; -import useGetToken from "./hooks/useGetToken"; -import BaseNavigation from "pages/BaseNavigation/BaseNavigation"; -import { useLocation } from "react-router-dom"; -import Banner from "components/Downbanner"; +import Close from '@mui/icons-material/Close'; +import { IconButton } from '@mui/material'; +import { AxiosError } from 'axios'; +import useGoogleAnalytics from 'hooks/useGoogleAnalytics'; +import { SnackbarKey, SnackbarProvider } from 'notistack'; +import { useEffect, useRef } from 'react'; +import { QueryCache, QueryClient, QueryClientProvider } from 'react-query'; +import Navbar from 'components/Navbar/Navbar'; +import useGetToken from './hooks/useGetToken'; +import BaseNavigation from 'pages/BaseNavigation/BaseNavigation'; +import { useLocation } from 'react-router-dom'; +import Banner from 'components/Banner'; const queryClient = new QueryClient({ - defaultOptions: { - queries: { - retry: 0, - refetchOnWindowFocus: false, - // staleTime: 5000, // https://tkdodo.eu/blog/practical-react-query#the-defaults-explained + defaultOptions: { + queries: { + retry: 0, + refetchOnWindowFocus: false, + // staleTime: 5000, // https://tkdodo.eu/blog/practical-react-query#the-defaults-explained + }, }, - }, - queryCache: new QueryCache({ - onError: (error) => { - console.log({ error }); - const responseStatus = (error as AxiosError)?.response?.status; - if (responseStatus && responseStatus === 404) { - console.error("could not find resource"); - } - }, - }), + queryCache: new QueryCache({ + onError: (error) => { + console.log({ error }); + const responseStatus = (error as AxiosError)?.response?.status; + if (responseStatus && responseStatus === 404) { + console.error('could not find resource'); + } + }, + }), }); declare global { - interface Window { - gtag?: ( - type: "event" | "config" | "get" | "set" | "consent", - action: "login" | "page_view", - options?: any - ) => void; - } + interface Window { + gtag?: ( + type: 'event' | 'config' | 'get' | 'set' | 'consent', + action: 'login' | 'page_view', + options?: any + ) => void; + } } function App() { - const notistackRef = useRef(null); - useGetToken(); - useGoogleAnalytics(); + const notistackRef = useRef(null); + useGetToken(); + useGoogleAnalytics(); - const location = useLocation(); - useEffect(() => { - if (window.gtag) { - window.gtag("event", "page_view", { - page_path: `${location.pathname}${location.search}`, - }); - } - }, [location]); + const location = useLocation(); + useEffect(() => { + if (window.gtag) { + window.gtag('event', 'page_view', { + page_path: `${location.pathname}${location.search}`, + }); + } + }, [location]); - const handleCloseSnackbar = - (key: SnackbarKey) => (_event: React.MouseEvent) => { - if (notistackRef?.current?.closeSnackbar) - notistackRef.current?.closeSnackbar(key); + const handleCloseSnackbar = (key: SnackbarKey) => (_event: React.MouseEvent) => { + if (notistackRef?.current?.closeSnackbar) notistackRef.current?.closeSnackbar(key); }; - return ( - - ( - - - - )} - > - - - - - - ); + return ( + + ( + + + + )} + > + + + + + + ); } export default App; diff --git a/compose/neurosynth-frontend/src/components/Downbanner.tsx b/compose/neurosynth-frontend/src/components/Banner.tsx similarity index 100% rename from compose/neurosynth-frontend/src/components/Downbanner.tsx rename to compose/neurosynth-frontend/src/components/Banner.tsx