mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-09 17:14:21 +02:00
create team assignment page
This commit is contained in:
parent
cef7c5f7b0
commit
220a8ac100
14
src/components/TeamAssignment/TeamAssignment.tsx
Normal file
14
src/components/TeamAssignment/TeamAssignment.tsx
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { FC, memo } from "react"
|
||||||
|
import ContentTitle from "../ui/Content/ContentTitle"
|
||||||
|
import withUserConnected from "../../utils/withUserConnected"
|
||||||
|
import { fetchTeamListIfNeed } from "../../store/teamList"
|
||||||
|
|
||||||
|
const TeamAssignment: FC = (): JSX.Element => (
|
||||||
|
<>
|
||||||
|
<ContentTitle title="Affectation aux équipes" />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default memo(withUserConnected(TeamAssignment))
|
||||||
|
|
||||||
|
export const fetchFor = [fetchTeamListIfNeed]
|
7
src/components/TeamAssignment/styles.module.scss
Executable file
7
src/components/TeamAssignment/styles.module.scss
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
@import "../../theme/variables";
|
||||||
|
@import "../../theme/mixins";
|
||||||
|
|
||||||
|
.title {
|
||||||
|
padding-bottom: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
@ -12,6 +12,7 @@ import ParticipationDetailsForm, {
|
|||||||
fetchFor as fetchForParticipationDetailsForm,
|
fetchFor as fetchForParticipationDetailsForm,
|
||||||
} from "./VolunteerBoard/ParticipationDetailsForm/ParticipationDetailsForm"
|
} from "./VolunteerBoard/ParticipationDetailsForm/ParticipationDetailsForm"
|
||||||
import PreRegisterForm from "./PreRegisterForm"
|
import PreRegisterForm from "./PreRegisterForm"
|
||||||
|
import TeamAssignment, { fetchFor as fetchForTeamAssignment } from "./TeamAssignment/TeamAssignment"
|
||||||
import TeamWishesForm, {
|
import TeamWishesForm, {
|
||||||
fetchFor as fetchForTeamWishesForm,
|
fetchFor as fetchForTeamWishesForm,
|
||||||
} from "./VolunteerBoard/TeamWishesForm/TeamWishesForm"
|
} from "./VolunteerBoard/TeamWishesForm/TeamWishesForm"
|
||||||
@ -35,6 +36,8 @@ export {
|
|||||||
ParticipationDetailsForm,
|
ParticipationDetailsForm,
|
||||||
fetchForParticipationDetailsForm,
|
fetchForParticipationDetailsForm,
|
||||||
PreRegisterForm,
|
PreRegisterForm,
|
||||||
|
TeamAssignment,
|
||||||
|
fetchForTeamAssignment,
|
||||||
TeamWishesForm,
|
TeamWishesForm,
|
||||||
fetchForTeamWishesForm,
|
fetchForTeamWishesForm,
|
||||||
VolunteerInfo,
|
VolunteerInfo,
|
||||||
|
29
src/pages/TeamAssignment/TeamAssignmentPage.tsx
Normal file
29
src/pages/TeamAssignment/TeamAssignmentPage.tsx
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { FC, memo } from "react"
|
||||||
|
import { RouteComponentProps } from "react-router-dom"
|
||||||
|
import { useSelector } from "react-redux"
|
||||||
|
|
||||||
|
import { AppThunk } from "../../store"
|
||||||
|
import { selectUserJwtToken } from "../../store/auth"
|
||||||
|
import Page from "../../components/ui/Page/Page"
|
||||||
|
import { TeamAssignment, fetchForTeamAssignment } from "../../components"
|
||||||
|
|
||||||
|
export type Props = RouteComponentProps
|
||||||
|
|
||||||
|
const TeamAssignmentPage: FC<Props> = (): JSX.Element => {
|
||||||
|
const jwtToken = useSelector(selectUserJwtToken)
|
||||||
|
|
||||||
|
if (jwtToken === undefined) return <p>Loading...</p>
|
||||||
|
if (jwtToken) {
|
||||||
|
return (
|
||||||
|
<Page>
|
||||||
|
<TeamAssignment />
|
||||||
|
</Page>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return <div>Besoin d'être identifié</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch server-side data here
|
||||||
|
export const loadData = (): AppThunk[] => [...fetchForTeamAssignment.map((f) => f())]
|
||||||
|
|
||||||
|
export default memo(TeamAssignmentPage)
|
16
src/pages/TeamAssignment/index.tsx
Executable file
16
src/pages/TeamAssignment/index.tsx
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
import loadable from "@loadable/component"
|
||||||
|
|
||||||
|
import { Loading, ErrorBoundary } from "../../components"
|
||||||
|
import { Props, loadData } from "./TeamAssignmentPage"
|
||||||
|
|
||||||
|
const TeamAssignmentPage = loadable(() => import("./TeamAssignmentPage"), {
|
||||||
|
fallback: <Loading />,
|
||||||
|
})
|
||||||
|
|
||||||
|
export default (props: Props): JSX.Element => (
|
||||||
|
<ErrorBoundary>
|
||||||
|
<TeamAssignmentPage {...props} />
|
||||||
|
</ErrorBoundary>
|
||||||
|
)
|
||||||
|
|
||||||
|
export { loadData }
|
@ -3,6 +3,7 @@ import { RouteConfig } from "react-router-config"
|
|||||||
import App from "../app"
|
import App from "../app"
|
||||||
import AsyncHome, { loadData as loadHomeData } from "../pages/Home"
|
import AsyncHome, { loadData as loadHomeData } from "../pages/Home"
|
||||||
import AsyncAnnouncements, { loadData as loadAnnouncementsData } from "../pages/Announcements"
|
import AsyncAnnouncements, { loadData as loadAnnouncementsData } from "../pages/Announcements"
|
||||||
|
import AsyncTeamAssignment, { loadData as loadTeamAssignmentData } from "../pages/TeamAssignment"
|
||||||
import AsyncPreRegisterPage, { loadData as loadPreRegisterPage } from "../pages/PreRegister"
|
import AsyncPreRegisterPage, { loadData as loadPreRegisterPage } from "../pages/PreRegister"
|
||||||
import AsyncTeams, { loadData as loadTeamsData } from "../pages/Teams"
|
import AsyncTeams, { loadData as loadTeamsData } from "../pages/Teams"
|
||||||
import AsyncBoard, { loadData as loadBoardData } from "../pages/Board"
|
import AsyncBoard, { loadData as loadBoardData } from "../pages/Board"
|
||||||
@ -84,6 +85,11 @@ export default [
|
|||||||
component: AsyncAnnouncements,
|
component: AsyncAnnouncements,
|
||||||
loadData: loadAnnouncementsData,
|
loadData: loadAnnouncementsData,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/team-assign-e26as",
|
||||||
|
component: AsyncTeamAssignment,
|
||||||
|
loadData: loadTeamAssignmentData,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
component: NotFound,
|
component: NotFound,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user