mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Moved SettingsProvider to root Providers component.
This commit is contained in:
parent
92a513e4d0
commit
44e243ad12
3 changed files with 30 additions and 26 deletions
|
|
@ -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 (
|
||||
<SettingsContext.Provider value={config}>
|
||||
<div className={styles.layout}>
|
||||
{!cloudMode && (
|
||||
<div className={styles.menu}>
|
||||
<SideNav items={items} shallow={true} selectedKey={getKey()} />
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.content}>{children}</div>
|
||||
</div>
|
||||
</SettingsContext.Provider>
|
||||
<div className={styles.layout}>
|
||||
{!cloudMode && (
|
||||
<div className={styles.menu}>
|
||||
<SideNav items={items} shallow={true} selectedKey={getKey()} />
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.content}>{children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue