mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 12:05:41 +01:00
DEV :: same styles
This commit is contained in:
parent
734f68a1b9
commit
b5a8714e00
2 changed files with 20 additions and 21 deletions
|
|
@ -1,7 +1,6 @@
|
|||
'use client';
|
||||
import { Loading } from 'react-basics';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { useEffect } from 'react';
|
||||
import Page from 'components/layout/Page';
|
||||
import FilterTags from 'components/metrics/FilterTags';
|
||||
import { useNavigation, useWebsite } from 'components/hooks';
|
||||
|
|
@ -22,26 +21,6 @@ export default function WebsiteDetails({ websiteId }: { websiteId: string }) {
|
|||
|
||||
const showLinks = !pathname.includes('/share/');
|
||||
const { view, ...params } = query;
|
||||
useEffect(() => {
|
||||
function sendHeightToParent() {
|
||||
const height = document.body.scrollHeight;
|
||||
window.parent.postMessage({ height: height }, '*');
|
||||
}
|
||||
|
||||
sendHeightToParent();
|
||||
|
||||
// Add event listener for resize
|
||||
window.addEventListener('resize', () => {
|
||||
sendHeightToParent();
|
||||
});
|
||||
|
||||
// Cleanup function to remove event listener
|
||||
return () => {
|
||||
window.removeEventListener('resize', () => {
|
||||
sendHeightToParent();
|
||||
});
|
||||
};
|
||||
}, [])
|
||||
return (
|
||||
<>
|
||||
{showLinks && <WebsiteHeader websiteId={websiteId} showLinks={showLinks} />}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
'use client';
|
||||
import WebsiteDetails from 'app/(main)/websites/[websiteId]/WebsiteDetails';
|
||||
import { useShareToken } from 'components/hooks';
|
||||
import { useEffect } from 'react';
|
||||
import Page from 'components/layout/Page';
|
||||
import Header from './Header';
|
||||
import styles from './SharePage.module.css';
|
||||
|
|
@ -11,7 +12,26 @@ export default function SharePage({ shareId }) {
|
|||
if (isLoading || !shareToken) {
|
||||
return null;
|
||||
}
|
||||
useEffect(() => {
|
||||
function sendHeightToParent() {
|
||||
const height = document.body.scrollHeight;
|
||||
window.parent.postMessage({ height: height }, '*');
|
||||
}
|
||||
|
||||
sendHeightToParent();
|
||||
|
||||
// Add event listener for resize
|
||||
window.addEventListener('resize', () => {
|
||||
sendHeightToParent();
|
||||
});
|
||||
|
||||
// Cleanup function to remove event listener
|
||||
return () => {
|
||||
window.removeEventListener('resize', () => {
|
||||
sendHeightToParent();
|
||||
});
|
||||
};
|
||||
}, [])
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<Page>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue