import { ThemeProvider } from "@material-ui/styles"; import { createMuiTheme } from "@material-ui/core/styles"; import { orange, teal } from "@material-ui/core/colors"; import Typography from "@material-ui/core/Typography"; import MuiLink from "@material-ui/core/Link"; import Box from "@material-ui/core/Box"; import Container from "@material-ui/core/Container"; import { MDXProvider } from "@mdx-js/react"; import React from "react"; import Head from "next/head"; import Link from "next/link"; import TopAppBar from "./TopAppBar"; const isValidURL = (url: string) => { try { new URL(url); } catch { return false; } return true; }; export const theme = createMuiTheme({ palette: { primary: { main: orange[900], }, secondary: { main: teal[400], }, }, typography: { fontFamily: "sans-serif", }, }); export const components: { [key in keyof HTMLElementTagNameMap]?: React.FC; } = { h1: (props) => ( <> {props.children} ), h2: (props) => , h3: (props) => , h4: (props) => , h5: (props) => , h6: (props) => , a: ({ href, ...props }: { href: string }) => { const url = `${process.env.NEXT_BASE_PATH}${href}`; return isValidURL(href) ? ( ) : ( ); }, p: (props) => , }; const MainTheme: React.FC = ({ children }) => ( {children} ); export default MainTheme;