@logicflow/dumi-theme-simple
Version:
Simple website theme based on dumi2.
162 lines • 8.36 kB
JavaScript
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); }
var _excluded = ["columns", "bottom", "isDynamicFooter", "rootDomain", "className"];
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); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import { GithubOutlined, QuestionCircleOutlined, WeiboOutlined, ZhihuOutlined } from '@ant-design/icons';
import { default as classnames, default as cx } from 'classnames';
import { FormattedMessage, useLocale, useSiteData } from 'dumi';
import { omit } from 'lodash-es';
import { default as RCFooter } from 'rc-footer';
import React from 'react';
import 'rc-footer/assets/index.less';
import styles from "./index.module.less";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
/**
* 底部菜单
* @returns
*/
export var Footer = function Footer(props) {
var columns = props.columns,
bottom = props.bottom,
isDynamicFooter = props.isDynamicFooter,
_props$rootDomain = props.rootDomain,
rootDomain = _props$rootDomain === void 0 ? '' : _props$rootDomain,
className = props.className,
restProps = _objectWithoutProperties(props, _excluded);
var _useSiteData = useSiteData(),
themeConfig = _useSiteData.themeConfig;
var locale = useLocale();
var lang = locale.id;
var _themeConfig$footerTh = themeConfig.footerTheme,
footerTheme = _themeConfig$footerTh === void 0 ? 'dark' : _themeConfig$footerTh,
footer = themeConfig.footer;
var _restProps$theme = restProps.theme,
theme = _restProps$theme === void 0 ? footerTheme : _restProps$theme;
var getColumns = function getColumns() {
// 如果外部没有传入 columns,则默认展示 LogicFlow footer
var col1 = {
title: 'Resources',
items: [{
title: 'LogicFlow',
url: 'https://site.logic-flow.cn',
openExternal: true
}, {
title: 'LogicFlow Engine',
url: 'https://github.com/didi/LogicFlow/tree/master/packages/engine',
openExternal: true
}]
};
var col2 = {
title: /*#__PURE__*/_jsx(FormattedMessage, {
id: "\u793E\u533A"
}),
items: [{
icon: /*#__PURE__*/_jsx(ZhihuOutlined, {
style: {
color: '#0084ff'
}
}),
title: /*#__PURE__*/_jsx(FormattedMessage, {
id: "\u77E5\u4E4E"
}),
url: 'https://www.zhihu.com/people/logicflow-guan-fang-jun/posts',
openExternal: true
}, {
icon: /*#__PURE__*/_jsx("img", {
src: "https://gw.alipayobjects.com/zos/rmsportal/mZBWtboYbnMkTBaRIuWQ.png",
alt: "seeconf"
}),
title: '稀土掘金',
description: /*#__PURE__*/_jsx(FormattedMessage, {
id: "\u7A00\u571F\u6398\u91D1"
}),
url: 'https://juejin.cn/user/2885546018354925',
openExternal: true
}]
};
var col3 = {
title: /*#__PURE__*/_jsx(FormattedMessage, {
id: "\u5E2E\u52A9"
}),
items: [{
icon: /*#__PURE__*/_jsx(GithubOutlined, {}),
title: 'GitHub',
url: 'https://github.com/didi/logicflow',
openExternal: true
}, {
icon: /*#__PURE__*/_jsx(QuestionCircleOutlined, {}),
title: /*#__PURE__*/_jsx(FormattedMessage, {
id: "StackOverflow"
}),
url: 'http://stackoverflow.com/questions/tagged/logicflow',
openExternal: true
}]
};
var more = {
title: /*#__PURE__*/_jsx(FormattedMessage, {
id: "\u53CB\u60C5\u94FE\u63A5"
}),
items: [{
icon: /*#__PURE__*/_jsx("img", {
src: "https://cdn.jsdelivr.net/gh/Logic-Flow/static@latest/docs/homepage/xiaojuLogo.png",
alt: "XIAOJUSURVEY"
}),
title: 'XIAOJUSURVEY',
url: 'https://github.com/didi/xiaoju-survey',
description: /*#__PURE__*/_jsx(FormattedMessage, {
id: "\u4F01\u4E1A\u7EA7\u8C03\u7814\u670D\u52A1\u63D0\u4F9B\u5546"
}),
openExternal: true
}]
};
return [col1, col2, col3, more];
};
return footer ? /*#__PURE__*/_jsx(RCFooter, _objectSpread({
maxColumnsPerRow: 5,
theme: theme,
columns: columns || getColumns(),
className: classnames(styles.footer, className, _defineProperty(_defineProperty({}, styles.light, theme === 'light'), styles.withMenu, isDynamicFooter)),
bottom: bottom || /*#__PURE__*/_jsx(_Fragment, {
children: /*#__PURE__*/_jsx("div", {
className: cx(styles.bottom, _defineProperty({}, styles.light, theme === 'light')),
children: theme === 'light' ? footer : /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsxs("div", {
children: [/*#__PURE__*/_jsx("a", {
href: "https://weibo.com/antv2017",
target: "_blank",
rel: "noopener noreferrer",
children: /*#__PURE__*/_jsx(WeiboOutlined, {})
}), /*#__PURE__*/_jsx("a", {
href: "https://zhuanlan.zhihu.com/aiux-antv",
target: "_blank",
rel: "noopener noreferrer",
children: /*#__PURE__*/_jsx(ZhihuOutlined, {})
}), /*#__PURE__*/_jsx("a", {
href: "https://github.com/antvis",
target: "_blank",
rel: "noopener noreferrer",
children: /*#__PURE__*/_jsx(GithubOutlined, {})
}), /*#__PURE__*/_jsx("a", {
href: "".concat(rootDomain, "/").concat(lang, "/about"),
children: /*#__PURE__*/_jsx(FormattedMessage, {
id: "\u5173\u4E8E\u6211\u4EEC"
})
})]
}), /*#__PURE__*/_jsxs("div", {
children: ["\xA9 ", new Date().getFullYear(), " Made with \u2764 by", ' ', /*#__PURE__*/_jsx("a", {
href: "https://xtech.antfin.com/",
children: "AntV"
})]
})]
})
})
})
}, omit(restProps, ['githubUrl']))) : null;
};