UNPKG

@hopepaddy/dumi-theme

Version:

dumi-theme-hopepaddy 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

28 lines (27 loc) 1.05 kB
import { ThemeProvider } from '@lobehub/ui'; import { extractStaticStyle } from 'antd-style'; import isEqual from 'fast-deep-equal'; import { memo } from 'react'; import GlobalStyle from "./GlobalStyle"; import { siteSelectors, useSiteStore, useThemeStore } from "../../store"; import _customToken from "../../styles/customToken"; //@ts-ignore import { jsx as _jsx } from "react/jsx-runtime"; import { jsxs as _jsxs } from "react/jsx-runtime"; global.__ANTD_CACHE__ = extractStaticStyle.cache; 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__*/_jsxs(ThemeProvider, { cache: extractStaticStyle.cache, customToken: function customToken(themeToken) { return Object.assign({}, _customToken(themeToken), userToken); }, prefixCls: 'site', themeMode: themeMode, children: [/*#__PURE__*/_jsx(GlobalStyle, {}), children] }); });