mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
DEV :: same styles
This commit is contained in:
parent
b5a8714e00
commit
f677224351
2 changed files with 21 additions and 21 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
'use client';
|
'use client';
|
||||||
import WebsiteDetails from 'app/(main)/websites/[websiteId]/WebsiteDetails';
|
import WebsiteDetails from 'app/(main)/websites/[websiteId]/WebsiteDetails';
|
||||||
import { useShareToken } from 'components/hooks';
|
import { useShareToken } from 'components/hooks';
|
||||||
import { useEffect } from 'react';
|
|
||||||
import Page from 'components/layout/Page';
|
import Page from 'components/layout/Page';
|
||||||
import Header from './Header';
|
import Header from './Header';
|
||||||
import styles from './SharePage.module.css';
|
import styles from './SharePage.module.css';
|
||||||
|
|
@ -12,26 +11,6 @@ export default function SharePage({ shareId }) {
|
||||||
if (isLoading || !shareToken) {
|
if (isLoading || !shareToken) {
|
||||||
return null;
|
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 (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<Page>
|
<Page>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,26 @@
|
||||||
|
import { useEffect } from 'react';
|
||||||
import SharePage from './SharePage';
|
import SharePage from './SharePage';
|
||||||
|
|
||||||
export default function ({ params: { shareId } }) {
|
export default function ({ params: { shareId } }) {
|
||||||
|
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 <SharePage shareId={shareId[0]} />;
|
return <SharePage shareId={shareId[0]} />;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue