dumi-theme-lobehub
Version:
dumi-theme-lobehub is a documentation site theme package designed for dumi2. It provides a more beautiful and user-friendly development and reading experience based on @lobehub/ui
58 lines • 2.52 kB
JavaScript
import { Footer as Foot } from '@lobehub/ui';
import { Divider } from 'antd';
import { useResponsive } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { memo } from 'react';
import { Center, Flexbox } from 'react-layout-kit';
import { siteSelectors, useSiteStore } from "../../store";
import { getColumns } from "./columns";
import { useStyles } from "./style";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var Footer = /*#__PURE__*/memo(function () {
var _useSiteStore = useSiteStore(function (s) {
return s.siteData;
}, isEqual),
themeConfig = _useSiteStore.themeConfig,
pkg = _useSiteStore.pkg;
var footerConfig = themeConfig.footerConfig,
footer = themeConfig.footer;
var githubUrl = useSiteStore(siteSelectors.github);
var _useStyles = useStyles(),
styles = _useStyles.styles,
theme = _useStyles.theme;
var _useResponsive = useResponsive(),
mobile = _useResponsive.mobile;
if (!footer) return;
var columns = footerConfig !== null && footerConfig !== void 0 && footerConfig.columns ? footerConfig === null || footerConfig === void 0 ? void 0 : footerConfig.columns : getColumns({
github: githubUrl || pkg.homepage
});
if (footerConfig !== null && footerConfig !== void 0 && footerConfig.resources) columns[0] = footerConfig === null || footerConfig === void 0 ? void 0 : footerConfig.resources;
if (footerConfig !== null && footerConfig !== void 0 && footerConfig.moreProducts) columns[3] = footerConfig === null || footerConfig === void 0 ? void 0 : footerConfig.moreProducts;
var bottomFooter = (footerConfig === null || footerConfig === void 0 ? void 0 : footerConfig.bottom) || footer;
return /*#__PURE__*/_jsx(Foot, {
bottom: mobile ? /*#__PURE__*/_jsxs(Center, {
className: styles.container,
children: ["Copyright \xA9 2022-", new Date().getFullYear(), /*#__PURE__*/_jsx(Flexbox, {
align: 'center',
dangerouslySetInnerHTML: {
__html: bottomFooter
},
horizontal: true
})]
}) : /*#__PURE__*/_jsxs(Center, {
horizontal: true,
children: ["Copyright \xA9 2022-", new Date().getFullYear(), " ", /*#__PURE__*/_jsx(Divider, {
type: 'vertical'
}), /*#__PURE__*/_jsx("span", {
dangerouslySetInnerHTML: {
__html: bottomFooter
}
})]
}),
columns: columns,
contentMaxWidth: theme.contentMaxWidth,
theme: theme.appearance
});
});
export default Footer;