Skip to content

Commit

Permalink
Merge pull request #244 from yosupo06/issue/53
Browse files Browse the repository at this point in the history
set title tag
  • Loading branch information
yosupo06 authored Sep 4, 2024
2 parents 8519d4b + ab1a660 commit 01e3b24
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/components/MainContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import Container, { ContainerProps } from "@mui/material/Container";
import React from "react";
import React, { useEffect } from "react";
import KatexTypography from "./katex/KatexTypography";

interface MainContainerProps extends ContainerProps {
title: string;
}

const MainContainer: React.FC<MainContainerProps> = (props) => (
<Container sx={{ paddingBottom: 3 }}>
<KatexTypography variant="h2">{props.title}</KatexTypography>
{props.children}
</Container>
);
const MainContainer: React.FC<MainContainerProps> = (props) => {
// TODO: <title> will be enough in near future: https://react.dev/reference/react-dom/components/title
useEffect(() => {
document.title = props.title;
}, []);
return (
<>
<Container sx={{ paddingBottom: 3 }}>
<KatexTypography variant="h2">{props.title}</KatexTypography>
{props.children}
</Container>
</>
);
};

export default MainContainer;

0 comments on commit 01e3b24

Please sign in to comment.