Merge branch 'dev' into analytics

This commit is contained in:
Mike Cao 2023-07-11 19:40:19 -07:00
commit 7148ab6374
3 changed files with 7 additions and 4 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 || {};

View File

@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
import { useRouter } from 'next/router';
import { get } from 'next-basics';
import { httpGet } from 'next-basics';
import enUS from 'public/intl/language/en-US.json';
const languageNames = {
@ -12,7 +12,7 @@ export function useLanguageNames(locale) {
const { basePath } = useRouter();
async function loadData(locale) {
const data = await get(`${basePath}/intl/language/${locale}.json`);
const { data } = await httpGet(`${basePath}/intl/language/${locale}.json`);
if (data) {
languageNames[locale] = data;