mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Merge branch 'dev' into analytics
This commit is contained in:
commit
7148ab6374
@ -1,4 +1,5 @@
|
|||||||
import { Loading } from 'react-basics';
|
import { Loading } from 'react-basics';
|
||||||
|
import { useRouter } from 'next/router';
|
||||||
import Page from 'components/layout/Page';
|
import Page from 'components/layout/Page';
|
||||||
import WebsiteChart from 'components/pages/websites/WebsiteChart';
|
import WebsiteChart from 'components/pages/websites/WebsiteChart';
|
||||||
import FilterTags from 'components/metrics/FilterTags';
|
import FilterTags from 'components/metrics/FilterTags';
|
||||||
@ -11,6 +12,8 @@ import { WebsiteMetricsBar } from './WebsiteMetricsBar';
|
|||||||
|
|
||||||
export default function WebsiteDetailsPage({ websiteId }) {
|
export default function WebsiteDetailsPage({ websiteId }) {
|
||||||
const { data: website, isLoading, error } = useWebsite(websiteId);
|
const { data: website, isLoading, error } = useWebsite(websiteId);
|
||||||
|
const { pathname } = useRouter();
|
||||||
|
const showLinks = !pathname.includes('/share/');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
query: { view, url, referrer, os, browser, device, country, region, city, title },
|
query: { view, url, referrer, os, browser, device, country, region, city, title },
|
||||||
@ -18,7 +21,7 @@ export default function WebsiteDetailsPage({ websiteId }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Page loading={isLoading} error={error}>
|
<Page loading={isLoading} error={error}>
|
||||||
<WebsiteHeader websiteId={websiteId} />
|
<WebsiteHeader websiteId={websiteId} showLinks={showLinks} />
|
||||||
<WebsiteMetricsBar websiteId={websiteId} sticky={true} />
|
<WebsiteMetricsBar websiteId={websiteId} sticky={true} />
|
||||||
<WebsiteChart websiteId={websiteId} />
|
<WebsiteChart websiteId={websiteId} />
|
||||||
<FilterTags
|
<FilterTags
|
||||||
|
@ -10,7 +10,7 @@ import { useMessages, useWebsite } from 'hooks';
|
|||||||
|
|
||||||
export function WebsiteHeader({ websiteId, showLinks = true, children }) {
|
export function WebsiteHeader({ websiteId, showLinks = true, children }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { asPath, pathname } = useRouter();
|
const { pathname } = useRouter();
|
||||||
const { data: website } = useWebsite(websiteId);
|
const { data: website } = useWebsite(websiteId);
|
||||||
const { name, domain } = website || {};
|
const { name, domain } = website || {};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { get } from 'next-basics';
|
import { httpGet } from 'next-basics';
|
||||||
import enUS from 'public/intl/language/en-US.json';
|
import enUS from 'public/intl/language/en-US.json';
|
||||||
|
|
||||||
const languageNames = {
|
const languageNames = {
|
||||||
@ -12,7 +12,7 @@ export function useLanguageNames(locale) {
|
|||||||
const { basePath } = useRouter();
|
const { basePath } = useRouter();
|
||||||
|
|
||||||
async function loadData(locale) {
|
async function loadData(locale) {
|
||||||
const data = await get(`${basePath}/intl/language/${locale}.json`);
|
const { data } = await httpGet(`${basePath}/intl/language/${locale}.json`);
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
languageNames[locale] = data;
|
languageNames[locale] = data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user