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
34 lines • 1.35 kB
JavaScript
import { ThemeProvider } from '@lobehub/ui';
import 'antd/dist/reset.css';
import isEqual from 'fast-deep-equal';
import { LazyMotion, domMax } from 'motion/react';
import { memo } from 'react';
import { siteSelectors, useSiteStore, useThemeStore } from "../../store";
import _customToken from "../../styles/customToken";
import AntdStaticMethods from "./AntdStaticMethods";
import ConfigProvider from "./ConfigProvider";
import StyleRegistry from "./StyleRegistry";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
export default /*#__PURE__*/memo(function (_ref) {
var children = _ref.children;
var themeMode = useThemeStore(function (st) {
return st.themeMode;
});
var userToken = useSiteStore(siteSelectors.token, isEqual);
return /*#__PURE__*/_jsx(StyleRegistry, {
children: /*#__PURE__*/_jsxs(ThemeProvider, {
appearance: themeMode !== 'auto' ? themeMode : undefined,
customToken: function customToken(themeToken) {
return Object.assign({}, _customToken(themeToken), userToken);
},
themeMode: themeMode,
children: [/*#__PURE__*/_jsx(AntdStaticMethods, {}), /*#__PURE__*/_jsx(ConfigProvider, {
children: /*#__PURE__*/_jsx(LazyMotion, {
features: domMax,
children: children
})
})]
})
});
});