diff --git a/src/app/(main)/settings/layout.tsx b/src/app/(main)/settings/layout.tsx
index 1c30d2db..e36b5b53 100644
--- a/src/app/(main)/settings/layout.tsx
+++ b/src/app/(main)/settings/layout.tsx
@@ -4,7 +4,6 @@ import useUser from 'components/hooks/useUser';
import useMessages from 'components/hooks/useMessages';
import SideNav from 'components/layout/SideNav';
import styles from './layout.module.css';
-import SettingsContext from './SettingsContext';
export default function SettingsLayout({ children }) {
const { user } = useUser();
@@ -25,25 +24,14 @@ export default function SettingsLayout({ children }) {
return null;
}
- const hostUrl = process.env.hostUrl || location.origin;
-
- const config = {
- settingsUrl: '/settings/websites',
- shareUrl: hostUrl,
- trackingCodeUrl: hostUrl,
- websitesUrl: `/websites`,
- };
-
return (
-
-
- {!cloudMode && (
-
-
-
- )}
-
{children}
-
-
+
+ {!cloudMode && (
+
+
+
+ )}
+
{children}
+
);
}
diff --git a/src/app/(main)/websites/[id]/realtime/Realtime.tsx b/src/app/(main)/websites/[id]/realtime/Realtime.tsx
index 34e29281..7f17190d 100644
--- a/src/app/(main)/websites/[id]/realtime/Realtime.tsx
+++ b/src/app/(main)/websites/[id]/realtime/Realtime.tsx
@@ -64,7 +64,7 @@ export function Realtime({ websiteId }) {
}
return arr;
}, [])
- .reduce((arr, { country }) => {
+ .reduce((arr: { x: any; y: number }[], { country }: any) => {
if (country) {
const row = arr.find(({ x }) => x === country);
diff --git a/src/app/Providers.tsx b/src/app/Providers.tsx
index c3d62699..0abebf86 100644
--- a/src/app/Providers.tsx
+++ b/src/app/Providers.tsx
@@ -3,6 +3,7 @@ import { IntlProvider } from 'react-intl';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactBasicsProvider } from 'react-basics';
import ErrorBoundary from 'components/common/ErrorBoundary';
+import SettingsContext from 'app/(main)/settings/SettingsContext';
import useLocale from 'components/hooks/useLocale';
import 'chartjs-adapter-date-fns';
@@ -24,14 +25,29 @@ function MessagesProvider({ children }) {
);
}
+function SettingsProvider({ children }) {
+ const hostUrl = process.env.hostUrl || location.origin;
+
+ const config = {
+ settingsUrl: '/settings/websites',
+ shareUrl: hostUrl,
+ trackingCodeUrl: hostUrl,
+ websitesUrl: `/websites`,
+ };
+
+ return {children};
+}
+
export function Providers({ children }) {
return (
-
-
- {children}
-
-
+
+
+
+ {children}
+
+
+
);
}