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";
.boardPage {
.pageWrapper {
@include page-wrapper-center;
}
.boardContent {
.pageContent {
@include page-content-wrapper(800px);
}

View File

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