From d52f171832797b26e02d87335d20da6f06630a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Thu, 6 Jun 2019 18:26:40 +0800 Subject: [PATCH] feat: rm unused code --- src/components/GlobalFooter/index.less | 29 ------------------- src/components/GlobalFooter/index.tsx | 40 -------------------------- src/layouts/UserLayout.tsx | 30 ++----------------- 3 files changed, 2 insertions(+), 97 deletions(-) delete mode 100644 src/components/GlobalFooter/index.less delete mode 100644 src/components/GlobalFooter/index.tsx diff --git a/src/components/GlobalFooter/index.less b/src/components/GlobalFooter/index.less deleted file mode 100644 index 3958eaa5..00000000 --- a/src/components/GlobalFooter/index.less +++ /dev/null @@ -1,29 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.globalFooter { - margin: 48px 0 24px 0; - padding: 0 16px; - text-align: center; - - .links { - margin-bottom: 8px; - - a { - color: @text-color-secondary; - transition: all 0.3s; - - &:not(:last-child) { - margin-right: 40px; - } - - &:hover { - color: @text-color; - } - } - } - - .copyright { - color: @text-color-secondary; - font-size: @font-size-base; - } -} diff --git a/src/components/GlobalFooter/index.tsx b/src/components/GlobalFooter/index.tsx deleted file mode 100644 index 01166243..00000000 --- a/src/components/GlobalFooter/index.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react'; -import classNames from 'classnames'; -import styles from './index.less'; - -export interface GlobalFooterProps { - links?: Array<{ - key?: string; - title: React.ReactNode; - href: string; - blankTarget?: boolean; - }>; - copyright?: React.ReactNode; - style?: React.CSSProperties; - className?: string; -} - -const GlobalFooter: React.SFC = ({ className, links, copyright }) => { - const clsString = classNames(styles.globalFooter, className); - return ( -
- {links && ( -
- {links.map(link => ( - - {link.title} - - ))} -
- )} - {copyright &&
{copyright}
} -
- ); -}; - -export default GlobalFooter; diff --git a/src/layouts/UserLayout.tsx b/src/layouts/UserLayout.tsx index 12b66b49..aecf7e9f 100644 --- a/src/layouts/UserLayout.tsx +++ b/src/layouts/UserLayout.tsx @@ -1,39 +1,13 @@ import SelectLang from '@/components/SelectLang'; -import GlobalFooter from '@/components/GlobalFooter'; import { ConnectProps, ConnectState } from '@/models/connect'; import { connect } from 'dva'; -import { Icon } from 'antd'; import React from 'react'; import DocumentTitle from 'react-document-title'; import { formatMessage } from 'umi-plugin-react/locale'; import Link from 'umi/link'; import logo from '../assets/logo.svg'; import styles from './UserLayout.less'; -import { MenuDataItem, getPageTitle, getMenuData } from '@ant-design/pro-layout'; - -const links = [ - { - key: 'help', - title: formatMessage({ id: 'layout.user.link.help' }), - href: '', - }, - { - key: 'privacy', - title: formatMessage({ id: 'layout.user.link.privacy' }), - href: '', - }, - { - key: 'terms', - title: formatMessage({ id: 'layout.user.link.terms' }), - href: '', - }, -]; - -const copyright = ( - <> - Copyright 2019 蚂蚁金服体验技术部出品 - -); +import { MenuDataItem, getPageTitle, getMenuData, DefaultFooter } from '@ant-design/pro-layout'; export interface UserLayoutProps extends ConnectProps { breadcrumbNameMap: { [path: string]: MenuDataItem }; @@ -79,7 +53,7 @@ const UserLayout: React.SFC = props => { {children} - + ); -- GitLab