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, FooterProps as RcFooterProps } from 'rc-footer'; import React from 'react'; import 'rc-footer/assets/index.less'; import styles from './index.module.less'; interface FooterProps extends RcFooterProps { rootDomain?: string; language?: string; githubUrl?: string; /** * 是否为动态 footer */ isDynamicFooter?: boolean; } /** * 底部菜单 * @returns */ const Footer: React.FC = (props) => { const { columns, bottom, language, isDynamicFooter, rootDomain = '', className, ...restProps } = props; const { themeConfig } = useSiteData(); const locale = useLocale(); const lang = locale.id; const { footerTheme = 'dark' } = themeConfig; const { theme = footerTheme } = restProps; const getColumns = () => { // 如果外部没有传入 columns,则默认展示 antv footer const col1 = { title: 'Resources', items: [ { title: 'Ant Design', url: 'https://ant.design', openExternal: true, }, { title: 'Galacea Effects', url: 'https://galacean.antgroup.com/effects/', openExternal: true, }, { title: 'Umi', description: , url: 'https://umijs.org', openExternal: true, }, { title: 'Dumi', description: , url: 'https://d.umijs.org', openExternal: true, }, { title: 'ahooks', description: , url: 'https://github.com/alibaba/hooks', openExternal: true, }, ], }; const col2 = { title: , items: [ { icon: , title: , url: 'http://zhuanlan.zhihu.com/xtech', openExternal: true, }, { icon: seeconf, title: 'SEE Conf', description: , url: 'https://seeconf.antfin.com/', openExternal: true, }, ], }; const col3 = { title: , items: [ { icon: , title: 'GitHub', url: 'https://github.com/antvis', openExternal: true, }, { icon: , title: , url: 'http://stackoverflow.com/questions/tagged/antv', openExternal: true, }, ], }; const more = { icon: more products, title: , items: [ { icon: Ant Design, title: 'Ant Design', url: 'https://ant.design', description: , openExternal: true, }, { icon: yuque, title: , url: 'https://yuque.com', description: , openExternal: true, }, { icon: ( Egg ), title: 'Egg', url: 'https://eggjs.org', description: , openExternal: true, }, { icon: kitchen, title: 'Kitchen', description: , url: 'https://kitchen.alipay.com', openExternal: true, }, { icon: ( Galacean ), title: 'Galacean', description: '互动图形解决方案', url: 'https://galacean.antgroup.com/', openExternal: true, }, { icon: xtech, title: , url: 'https://xtech.antfin.com/', openExternal: true, }, ], }; return [col1, col2, col3, more]; }; return (
{theme === 'light' ? ( `© Copyright ${new Date().getFullYear()} Ant Group Co., Ltd..备案号:京ICP备15032932号-38` ) : ( <>
© {new Date().getFullYear()} Made with ❤ by AntV
)}
) } {...omit(restProps, ['githubUrl'])} /> ); }; export default Footer;