gatsby-openrpc-theme
Version:
A gatsby theme for generated OpenRPC documentation
40 lines • 2.8 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const material_1 = require("@mui/material");
const Footer = ({ footerLinks = [], copyrightYear = new Date().getFullYear(), copyrightText = '©', organizationName = 'OpenRPC', organizationUrl = 'https://open-rpc.org/', builtWithText = 'Documentation built with', builtWithName = 'Gatsby', builtWithUrl = 'https://www.gatsbyjs.com/', }) => {
const theme = (0, material_1.useTheme)();
const isDarkMode = theme.palette.mode === 'dark';
return (react_1.default.createElement(material_1.Box, { component: "footer", sx: {
py: 3,
px: 2,
mt: 'auto',
backgroundColor: isDarkMode ? theme.palette.grey[900] : theme.palette.grey[200],
} },
react_1.default.createElement(material_1.Container, { maxWidth: "sm" },
footerLinks.length > 0 && (react_1.default.createElement(material_1.Box, { sx: { display: 'flex', justifyContent: 'center', flexWrap: 'wrap', mb: 2 } }, footerLinks.map((link, index) => (react_1.default.createElement(react_1.default.Fragment, { key: link.name },
react_1.default.createElement(material_1.Link, { href: link.link, color: "inherit", sx: {
mx: 1,
color: isDarkMode ? theme.palette.primary.light : theme.palette.primary.dark,
} }, link.name),
index < footerLinks.length - 1 && (react_1.default.createElement(material_1.Typography, { component: "span", color: isDarkMode ? 'text.secondary' : 'text.primary', sx: { mx: 0.5 } }, "\u2022"))))))),
react_1.default.createElement(material_1.Typography, { variant: "body2", color: "text.secondary", align: "center" },
copyrightText,
" ",
copyrightYear,
' ',
react_1.default.createElement(material_1.Link, { color: "inherit", href: organizationUrl, sx: {
color: isDarkMode ? theme.palette.primary.light : theme.palette.primary.dark,
} }, organizationName)),
react_1.default.createElement(material_1.Typography, { variant: "body2", color: "text.secondary", align: "center" },
builtWithText,
' ',
react_1.default.createElement(material_1.Link, { color: "inherit", href: builtWithUrl, sx: {
color: isDarkMode ? theme.palette.primary.light : theme.palette.primary.dark,
} }, builtWithName)))));
};
exports.default = Footer;
//# sourceMappingURL=Footer.js.map