-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Add react-markdown dependency and update Footer and Main co…
…mponents
- Loading branch information
1 parent
0a70d2e
commit f0a174f
Showing
5 changed files
with
726 additions
and
31 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
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"use client"; | ||
import { DialogTitle, Dialog, Box, Link } from "@mui/material"; | ||
import { useState, useEffect } from "react"; | ||
import ReactMarkdown from "react-markdown"; | ||
|
||
export interface DialogAboutMeProps { | ||
open: boolean; | ||
onClose: () => void; | ||
} | ||
|
||
export default function DialogAboutMe(props: DialogAboutMeProps) { | ||
const [markdownContent, setMarkdownContent] = useState<string>(""); | ||
|
||
useEffect(() => { | ||
const fetchMarkdown = async () => { | ||
const response = await fetch( | ||
"https://raw.githubusercontent.com/ItsukiKigoshi/ItsukiKigoshi/main/README.md" | ||
); | ||
const text = await response.text(); | ||
setMarkdownContent(text); | ||
}; | ||
fetchMarkdown(); | ||
}, []); | ||
|
||
const { onClose, open } = props; | ||
|
||
const handleClose = () => { | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<Dialog onClose={handleClose} open={open}> | ||
<DialogTitle> | ||
About Me: Itsuki Kigoshi ( | ||
<Link | ||
href="https://github.com/ItsukiKigoshi/ItsukiKigoshi/blob/main/README.md" | ||
target="_blank" | ||
> | ||
Source | ||
</Link> | ||
) | ||
</DialogTitle> | ||
<Box component="section" sx={{ px: 4, pb: 4 }}> | ||
<ReactMarkdown>{markdownContent}</ReactMarkdown> | ||
</Box> | ||
</Dialog> | ||
); | ||
} |
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
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
Oops, something went wrong.