mirror of
https://github.com/umami-software/umami.git
synced 2026-02-23 14:05:35 +01:00
Changed route ids to be more explicit.
This commit is contained in:
parent
1a70350936
commit
18e36aa7b3
105 changed files with 86 additions and 76 deletions
20
src/app/(main)/teams/[teamId]/Team.tsx
Normal file
20
src/app/(main)/teams/[teamId]/Team.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
'use client';
|
||||
import TeamsContext from '../TeamsContext';
|
||||
import { Loading } from 'react-basics';
|
||||
import { useTeam } from 'components/hooks';
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
export default function Team({ children }) {
|
||||
const { id: teamId } = useParams();
|
||||
const { data: team, isLoading, error } = useTeam(teamId as string);
|
||||
|
||||
if (error) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (isLoading) {
|
||||
return <Loading position="page" />;
|
||||
}
|
||||
|
||||
return <TeamsContext.Provider value={team}>{children}</TeamsContext.Provider>;
|
||||
}
|
||||
5
src/app/(main)/teams/[teamId]/layout.tsx
Normal file
5
src/app/(main)/teams/[teamId]/layout.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import Team from './Team';
|
||||
|
||||
export default function ({ children }) {
|
||||
return <Team>{children}</Team>;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import WebsiteDetails from '../../../../websites/[websiteId]/WebsiteDetails';
|
||||
|
||||
export default function TeamWebsitePage({ params: { websiteId } }) {
|
||||
return <WebsiteDetails websiteId={websiteId} />;
|
||||
}
|
||||
11
src/app/(main)/teams/[teamId]/websites/page.tsx
Normal file
11
src/app/(main)/teams/[teamId]/websites/page.tsx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import WebsitesDataTable from 'app/(main)/settings/websites/WebsitesDataTable';
|
||||
import WebsitesHeader from 'app/(main)/settings/websites/WebsitesHeader';
|
||||
|
||||
export default function TeamWebsitesPage({ params: { teamId } }: { params: { teamId: string } }) {
|
||||
return (
|
||||
<>
|
||||
<WebsitesHeader teamId={teamId} />
|
||||
<WebsitesDataTable teamId={teamId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue