mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-01 12:29:35 +01:00
stay in team context for website header links
This commit is contained in:
parent
758b289a51
commit
4b40b4e9cf
@ -0,0 +1,3 @@
|
||||
import Page from 'app/(main)/websites/[websiteId]/event-data/page';
|
||||
|
||||
export default Page;
|
@ -0,0 +1,3 @@
|
||||
import Page from 'app/(main)/websites/[websiteId]/realtime/page';
|
||||
|
||||
export default Page;
|
@ -0,0 +1,3 @@
|
||||
import Page from 'app/(main)/websites/[websiteId]/reports/page';
|
||||
|
||||
export default Page;
|
@ -1,6 +1,6 @@
|
||||
import classNames from 'classnames';
|
||||
import Favicon from 'components/common/Favicon';
|
||||
import { useMessages, useWebsite } from 'components/hooks';
|
||||
import { useMessages, useTeamUrl, useWebsite } from 'components/hooks';
|
||||
import Icons from 'components/icons';
|
||||
import ActiveUsers from 'components/metrics/ActiveUsers';
|
||||
import Link from 'next/link';
|
||||
@ -19,6 +19,7 @@ export function WebsiteHeader({
|
||||
children?: ReactNode;
|
||||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { renderTeamUrl } = useTeamUrl();
|
||||
const pathname = usePathname();
|
||||
const { data: website } = useWebsite(websiteId);
|
||||
const { name, domain } = website || {};
|
||||
@ -62,7 +63,11 @@ export function WebsiteHeader({
|
||||
: pathname.match(/^\/websites\/[\w-]+$/);
|
||||
|
||||
return (
|
||||
<Link key={label} href={`/websites/${websiteId}${path}`} shallow={true}>
|
||||
<Link
|
||||
key={label}
|
||||
href={renderTeamUrl(`/websites/${websiteId}${path}`)}
|
||||
shallow={true}
|
||||
>
|
||||
<Button
|
||||
variant="quiet"
|
||||
className={classNames({
|
||||
|
Loading…
Reference in New Issue
Block a user