Hide links on share page.

This commit is contained in:
Mike Cao 2023-07-11 19:33:34 -07:00
parent 80d3bf6ab3
commit 5eea66aa53
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import { Loading } from 'react-basics';
import { useRouter } from 'next/router';
import Page from 'components/layout/Page';
import WebsiteChart from 'components/pages/websites/WebsiteChart';
import FilterTags from 'components/metrics/FilterTags';
@ -11,6 +12,8 @@ import { WebsiteMetricsBar } from './WebsiteMetricsBar';
export default function WebsiteDetailsPage({ websiteId }) {
const { data: website, isLoading, error } = useWebsite(websiteId);
const { pathname } = useRouter();
const showLinks = !pathname.includes('/share/');
const {
query: { view, url, referrer, os, browser, device, country, region, city, title },
@ -18,7 +21,7 @@ export default function WebsiteDetailsPage({ websiteId }) {
return (
<Page loading={isLoading} error={error}>
<WebsiteHeader websiteId={websiteId} />
<WebsiteHeader websiteId={websiteId} showLinks={showLinks} />
<WebsiteMetricsBar websiteId={websiteId} sticky={true} />
<WebsiteChart websiteId={websiteId} />
<FilterTags

View File

@ -10,7 +10,7 @@ import { useMessages, useWebsite } from 'hooks';
export function WebsiteHeader({ websiteId, showLinks = true, children }) {
const { formatMessage, labels } = useMessages();
const { asPath, pathname } = useRouter();
const { pathname } = useRouter();
const { data: website } = useWebsite(websiteId);
const { name, domain } = website || {};