From 8f26820a27cb3e573b5e86ba42106a4a1a6af7b2 Mon Sep 17 00:00:00 2001 From: m-tartari <37861893+m-tartari@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:42:50 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(App):=20add=20`Page`=20templat?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/templates/Page/Page.tsx | 39 ++++++++++++++++++++++++++ src/components/templates/Page/index.ts | 1 + src/components/templates/index.ts | 1 + 3 files changed, 41 insertions(+) create mode 100644 src/components/templates/Page/Page.tsx create mode 100644 src/components/templates/Page/index.ts create mode 100644 src/components/templates/index.ts diff --git a/src/components/templates/Page/Page.tsx b/src/components/templates/Page/Page.tsx new file mode 100644 index 0000000..7e2db23 --- /dev/null +++ b/src/components/templates/Page/Page.tsx @@ -0,0 +1,39 @@ +import React from 'react' +import { Box, BoxProps, Container, Typography } from '@mui/material' + +import { Footer, Toobar } from 'components/molecules' + +/** + * React function component that implements the default page template. + * @see BoxProps from '@mui/material' for props + */ +const Page: React.FC = ({ title, children, ...props }) => { + React.useEffect(() => { + if (title) { + document.title = `Michele Tartari - ${title}` + } + }, [title]) + + return ( + + + + {/* Children is included in props */} + {title && ( + <> + + {title} + + + )} + {children} + +