UNPKG

@logicflow/dumi-theme-simple

Version:
90 lines (89 loc) 5.01 kB
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } import React from 'react'; import { isArray, size, get } from 'lodash-es'; import { useLocale, useSiteData } from 'dumi'; import { SEO } from "dumi/theme/slots/SEO"; import { Header } from "dumi/theme/slots/Header"; // import { Detail } from '../../slots/Detail'; import { LFBanner } from "dumi/theme/slots/LFBanner"; import { Features } from "dumi/theme/slots/Features"; import { Cases } from "dumi/theme/slots/Cases"; import { CustomSlider } from "dumi/theme/slots/Swipper"; import { Companies } from "dumi/theme/slots/Companies"; import { CompanyGallery } from "dumi/theme/slots/CompanyGallery"; import { Footer } from "dumi/theme/slots/Footer"; /** * Index 路由下的入口 * - 获取数据 * - 组合 slots 下的木偶组件 */ import { jsx as _jsx } from "react/jsx-runtime"; import { Fragment as _Fragment } from "react/jsx-runtime"; import { jsxs as _jsxs } from "react/jsx-runtime"; export var Index = function Index() { var locale = useLocale(); var _useSiteData = useSiteData(), themeConfig = _useSiteData.themeConfig; var title = themeConfig.title, siteUrl = themeConfig.siteUrl, githubUrl = themeConfig.githubUrl, showLFBanner = themeConfig.showLFBanner, showSearch = themeConfig.showSearch, showGithubCorner = themeConfig.showGithubCorner, showGithubStars = themeConfig.showGithubStars, showLanguageSwitcher = themeConfig.showLanguageSwitcher, showWxQrcode = themeConfig.showWxQrcode, defaultLanguage = themeConfig.defaultLanguage, versions = themeConfig.versions, ecosystems = themeConfig.ecosystems, navs = themeConfig.navs, detail = themeConfig.detail, news = themeConfig.news, companyGallery = themeConfig.companyGallery, companies = themeConfig.companies, features = themeConfig.features, cases = themeConfig.cases, className = themeConfig.className, style = themeConfig.style, id = themeConfig.id, footerColumns = themeConfig.footerColumns; var detailProps = _objectSpread({ githubUrl: githubUrl, showGithubStars: showGithubStars, news: news, features: features }, detail); var featuresProps = { title: get(features, ['title']), features: isArray(features) ? features : get(features, ['cards'], []), className: className, style: style, id: id }; var casesProps = { cases: cases, style: style, className: className }; var metaTitle = detailProps.title; return /*#__PURE__*/_jsxs(_Fragment, { children: [/*#__PURE__*/_jsx(SEO, { title: "".concat(metaTitle[locale.id]), titleSuffix: "LogicFlow", lang: locale.id }), /*#__PURE__*/_jsx(Header, {}), showLFBanner ? /*#__PURE__*/_jsx(LFBanner, _objectSpread({}, detailProps)) : null, size(featuresProps.features) ? /*#__PURE__*/_jsx(Features, _objectSpread({}, featuresProps)) : null, size(cases) ? /*#__PURE__*/_jsx(Cases, _objectSpread({}, casesProps)) : null, /*#__PURE__*/_jsx(CustomSlider, {}), companyGallery ? /*#__PURE__*/_jsx(CompanyGallery, { title: "\u5408\u4F5C\u4F19\u4F34", companyGallery: companyGallery }) : null, !companyGallery && size(companies) ? /*#__PURE__*/_jsx(Companies, { title: "\u611F\u8C22\u4FE1\u8D56", companies: companies }) : null, /*#__PURE__*/_jsx(Footer, { columns: footerColumns })] }); };