-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from yosupo06/issue/53
set title tag
- Loading branch information
Showing
1 changed file
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |