mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Allow embedding of share page.
This commit is contained in:
parent
9cb6046844
commit
eda2c07ea3
10 changed files with 58 additions and 39 deletions
27
src/app/(main)/App.tsx
Normal file
27
src/app/(main)/App.tsx
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
'use client';
|
||||
import Script from 'next/script';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import UpdateNotice from 'components/common/UpdateNotice';
|
||||
import { useRequireLogin, useConfig } from 'components/hooks';
|
||||
|
||||
export function App({ children }) {
|
||||
const { user } = useRequireLogin();
|
||||
const config = useConfig();
|
||||
const pathname = usePathname();
|
||||
|
||||
if (!user || !config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{children}
|
||||
<UpdateNotice user={user} config={config} />
|
||||
{process.env.NODE_ENV === 'production' && !pathname.includes('/share/') && (
|
||||
<Script src={`telemetry.js`} />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
Loading…
Add table
Add a link
Reference in a new issue