diff --git a/src/components/Layout/GA4Toggle.tsx b/src/components/Layout/GA4Toggle.tsx deleted file mode 100644 index 55fac1a1..00000000 --- a/src/components/Layout/GA4Toggle.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import * as React from "react" - -import Grid from "@mui/material/Grid/Grid" -import Switch from '@mui/material/Switch'; -import Tooltip from '@mui/material/Tooltip'; - -import { GAVersion } from "@/constants" - -interface GA4ToggleProps { - gaVersion: GAVersion - setGAVersion: (version: GAVersion) => void -} - -const GA4Toggle: React.FC = ({ setGAVersion, gaVersion }) => { - return ( - - - UA - - { - if (e.target.checked === true) { - setGAVersion(GAVersion.GoogleAnalytics4) - } else { - setGAVersion(GAVersion.UniversalAnalytics) - } - }} - name="use GA4" - color="primary" - /> - - GA4 - - - ) -} - -export default GA4Toggle diff --git a/src/components/Layout/index.tsx b/src/components/Layout/index.tsx index 3944a7d6..de689086 100644 --- a/src/components/Layout/index.tsx +++ b/src/components/Layout/index.tsx @@ -41,7 +41,6 @@ import { useGAVersion } from "../../hooks" import { GAVersion, Url } from "../../constants" import Spinner from "../Spinner" import { linkData } from "./links" -import GA4Toggle from "./GA4Toggle" import BugReport from "./BugReport" import Loadable from "../Loadable" import useLogin2, { UserStatus } from "./useLogin" @@ -130,7 +129,12 @@ const Template: React.FC> = ({ const newLocation = window.location.href.replace( window.location.hostname, newHostname ); window.location.replace(newLocation); } - //}, 1000); + + if( !window.location.search && window.location.pathname === '/' ) { + const newLocation = window.location.pathname = '/ga4/'; + window.location.replace(newLocation); + } + //}, 1000); return; }, []); diff --git a/src/components/Spinner.tsx b/src/components/Spinner.tsx index cdce1e40..87df7331 100644 --- a/src/components/Spinner.tsx +++ b/src/components/Spinner.tsx @@ -1,7 +1,7 @@ import * as React from "react" import { styled } from '@mui/material/styles'; import { useTheme } from "@mui/material" -import {Circles} from "react-loader-spinner" +import { Circles } from 'react-loader-spinner' import {PropsWithChildren} from 'react'; const PREFIX = 'Spinner';