Skip to content

Commit

Permalink
Hide links on share page.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Jul 12, 2023
1 parent 80d3bf6 commit 5eea66a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion components/pages/websites/WebsiteDetailsPage.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -11,14 +12,16 @@ 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 },
} = usePageQuery();

return (
<Page loading={isLoading} error={error}>
<WebsiteHeader websiteId={websiteId} />
<WebsiteHeader websiteId={websiteId} showLinks={showLinks} />
<WebsiteMetricsBar websiteId={websiteId} sticky={true} />
<WebsiteChart websiteId={websiteId} />
<FilterTags
Expand Down
2 changes: 1 addition & 1 deletion components/pages/websites/WebsiteHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {};

Expand Down

0 comments on commit 5eea66a

Please sign in to comment.