mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
Upgrade to Next 14.
This commit is contained in:
parent
44e243ad12
commit
08bd9e8357
4 changed files with 74 additions and 68 deletions
|
|
@ -1,4 +1,5 @@
|
|||
'use client';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ReactBasicsProvider } from 'react-basics';
|
||||
|
|
@ -26,14 +27,18 @@ function MessagesProvider({ children }) {
|
|||
}
|
||||
|
||||
function SettingsProvider({ children }) {
|
||||
const hostUrl = process.env.hostUrl || location.origin;
|
||||
const [config, setConfig] = useState({});
|
||||
|
||||
const config = {
|
||||
settingsUrl: '/settings/websites',
|
||||
shareUrl: hostUrl,
|
||||
trackingCodeUrl: hostUrl,
|
||||
websitesUrl: `/websites`,
|
||||
};
|
||||
useEffect(() => {
|
||||
const hostUrl = process.env.hostUrl || window?.location.origin;
|
||||
|
||||
setConfig({
|
||||
settingsUrl: '/settings/websites',
|
||||
shareUrl: hostUrl,
|
||||
trackingCodeUrl: hostUrl,
|
||||
websitesUrl: `/websites`,
|
||||
});
|
||||
}, []);
|
||||
|
||||
return <SettingsContext.Provider value={config}>{children}</SettingsContext.Provider>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue