mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 03:55:37 +01:00
DEV :: same styles
This commit is contained in:
parent
edce3c5223
commit
83b6214260
3 changed files with 22 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
'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';
|
||||
|
|
@ -12,18 +13,34 @@ import WebsiteTableView from './WebsiteTableView';
|
|||
|
||||
export default function WebsiteDetails({ websiteId }: { websiteId: string }) {
|
||||
const { data: website, isLoading, error } = useWebsite(websiteId);
|
||||
const pathname = usePathname();
|
||||
const { query } = useNavigation();
|
||||
|
||||
if (isLoading || error) {
|
||||
return <Page isLoading={isLoading} error={error} />;
|
||||
}
|
||||
|
||||
const showLinks = false
|
||||
const showLinks = !pathname.includes('/share/');
|
||||
const { view, ...params } = query;
|
||||
useEffect(() => {
|
||||
// Send message to parent window with content height
|
||||
const sendHeight = () => {
|
||||
const height = document.body.scrollHeight;
|
||||
window.parent.postMessage({ height: height }, "*");
|
||||
};
|
||||
|
||||
// Send content height initially and on resize
|
||||
sendHeight();
|
||||
window.addEventListener('resize', sendHeight);
|
||||
|
||||
// Cleanup event listener on component unmount
|
||||
return () => {
|
||||
window.removeEventListener('resize', sendHeight);
|
||||
};
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
<WebsiteHeader websiteId={websiteId} showLinks={showLinks} />
|
||||
{showLinks && <WebsiteHeader websiteId={websiteId} showLinks={showLinks} />}
|
||||
<FilterTags websiteId={websiteId} params={params} />
|
||||
<WebsiteMetricsBar websiteId={websiteId} sticky={false} />
|
||||
<WebsiteChart websiteId={websiteId} />
|
||||
|
|
|
|||
|
|
@ -48,11 +48,12 @@ export function WebsiteHeader({
|
|||
|
||||
return (
|
||||
<div className={styles.header}>
|
||||
{showLinks && (
|
||||
<div className={styles.title}>
|
||||
<Favicon domain={domain} />
|
||||
<Text>{name}</Text>
|
||||
<ActiveUsers websiteId={websiteId} />
|
||||
</div>
|
||||
</div>)}
|
||||
<div className={styles.actions}>
|
||||
{showLinks && (
|
||||
<div className={styles.links}>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
justify-content: end;
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue