-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ajout GroupEspaceCo et utilisation de nouveau système de layout #…
- Loading branch information
Showing
14 changed files
with
121 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { lazy, useMemo } from "react"; | ||
import { Route } from "type-route"; | ||
|
||
import AppLayout from "@/components/Layout/AppLayout"; | ||
import { datastoreNavItems } from "@/config/navItems/datastoreNavItems"; | ||
import PageNotFoundWithLayout from "@/pages/error/PageNotFoundWithLayout"; | ||
import { groups } from "./router"; | ||
|
||
const EspaceCoCommunityList = lazy(() => import("../espaceco/pages/communities/Communities")); | ||
const EspaceCoCreateCommunity = lazy(() => import("../espaceco/pages/communities/CreateCommunity")); | ||
const EspaceCoManageCommunity = lazy(() => import("../espaceco/pages/communities/ManageCommunity")); | ||
const MemberInvitation = lazy(() => import("../espaceco/pages/communities/MemberInvitation")); | ||
|
||
interface IGroupEspaceCoProps { | ||
route: Route<typeof groups.espaceco>; | ||
} | ||
|
||
function GroupEspaceCo(props: IGroupEspaceCoProps) { | ||
const { route, ...rest } = props; | ||
|
||
const navItems = datastoreNavItems(); | ||
|
||
const content: { render: JSX.Element } = useMemo(() => { | ||
switch (route.name) { | ||
case "espaceco_community_list": | ||
return { render: <EspaceCoCommunityList /> }; | ||
case "espaceco_create_community": | ||
return { render: <EspaceCoCreateCommunity communityId={route.params.communityId} /> }; | ||
case "espaceco_manage_community": | ||
return { render: <EspaceCoManageCommunity communityId={route.params.communityId} /> }; | ||
case "espaceco_member_invitation": | ||
return { render: <MemberInvitation communityId={route.params.communityId} /> }; | ||
} | ||
}, [route]); | ||
|
||
if (!content) { | ||
return <PageNotFoundWithLayout />; | ||
} | ||
|
||
return ( | ||
<AppLayout {...rest} navItems={navItems}> | ||
{content.render} | ||
</AppLayout> | ||
); | ||
} | ||
|
||
export default GroupEspaceCo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.