Changed route ids to be more explicit.
This commit is contained in:
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} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user