create Page component

This commit is contained in:
memeriau 2022-01-29 23:58:55 +01:00
parent c2f4946da0
commit b842174ebe
3 changed files with 22 additions and 10 deletions

View File

@ -0,0 +1,14 @@
import React, { FC } from "react"
import styles from "./styles.module.scss"
type Props = {
children: React.ReactNode
}
const Page: FC<Props> = ({ children }): JSX.Element => (
<div className={styles.pageWrapper}>
<div className={styles.pageContent}>{children}</div>
</div>
)
export default Page

View File

@ -1,9 +1,9 @@
@import "../../theme/mixins"; @import "../../theme/mixins";
.boardPage { .pageWrapper {
@include page-wrapper-center; @include page-wrapper-center;
} }
.boardContent { .pageContent {
@include page-content-wrapper(800px); @include page-content-wrapper(800px);
} }

View File

@ -6,9 +6,9 @@ import { AppThunk } from "../../store"
import { fetchVolunteerDayWishesSetIfNeed } from "../../store/volunteerDayWishesSet" import { fetchVolunteerDayWishesSetIfNeed } from "../../store/volunteerDayWishesSet"
import { selectUserJwtToken } from "../../store/auth" import { selectUserJwtToken } from "../../store/auth"
import DDayInformations from "../../components/VolunteerBoard/DDayInformations/DDaysInformations" import DDayInformations from "../../components/VolunteerBoard/DDayInformations/DDaysInformations"
import styles from "./styles.module.scss"
import DayWishes from "../../components/VolunteerBoard/DayWishes/DayWishes" import DayWishes from "../../components/VolunteerBoard/DayWishes/DayWishes"
import DayWishesFormModal from "../../components/VolunteerBoard/DayWishesForm/DayWishesFormModal" import DayWishesFormModal from "../../components/VolunteerBoard/DayWishesForm/DayWishesFormModal"
import Page from "../../components/Page/Page"
export type Props = RouteComponentProps export type Props = RouteComponentProps
@ -18,13 +18,11 @@ const BoardPage: FC<Props> = (): JSX.Element => {
if (jwtToken === undefined) return <p>Loading...</p> if (jwtToken === undefined) return <p>Loading...</p>
if (jwtToken) { if (jwtToken) {
return ( return (
<div className={styles.boardPage}> <Page>
<div className={styles.boardContent}>
<DayWishes /> <DayWishes />
<DayWishesFormModal /> <DayWishesFormModal />
<DDayInformations /> <DDayInformations />
</div> </Page>
</div>
) )
} }
return <div>Besoin d&apos;être identifié</div> return <div>Besoin d&apos;être identifié</div>