diff --git a/config/config.ts b/config/config.ts index 9146e609..b648507d 100644 --- a/config/config.ts +++ b/config/config.ts @@ -177,7 +177,6 @@ export default { // Theme for antd: https://ant.design/docs/react/customize-theme-cn theme: { // ...darkTheme, - 'primary-color': primaryColor, }, define: { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: diff --git a/config/defaultSettings.ts b/config/defaultSettings.ts index 4d860940..724c950c 100644 --- a/config/defaultSettings.ts +++ b/config/defaultSettings.ts @@ -44,7 +44,8 @@ export interface DefaultSettings { export default { navTheme: 'dark', - primaryColor: '#1890FF', + // 拂晓蓝 + primaryColor: 'daybreak', layout: 'sidemenu', contentWidth: 'Fluid', fixedHeader: false, diff --git a/package.json b/package.json index 032bbc3b..e37663f9 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ ], "dependencies": { "@ant-design/dark-theme": "1.0.3", - "@ant-design/pro-layout": "4.8.0", + "@ant-design/pro-layout": "4.8.3", "@antv/data-set": "^0.10.2", "antd": "^3.23.6", "classnames": "^2.2.6", @@ -80,7 +80,7 @@ "umi-request": "^1.0.8" }, "devDependencies": { - "@ant-design/pro-cli": "^1.0.13", + "@ant-design/pro-cli": "^1.0.14", "@types/classnames": "^2.2.7", "@types/express": "^4.17.0", "@types/history": "^4.7.2", diff --git a/src/components/CopyBlock/index.less b/src/components/CopyBlock/index.less deleted file mode 100644 index 00a9214e..00000000 --- a/src/components/CopyBlock/index.less +++ /dev/null @@ -1,30 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.copy-block { - position: fixed; - right: 80px; - bottom: 40px; - z-index: 99; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - width: 40px; - height: 40px; - font-size: 20px; - background: @input-bg; - border-radius: 40px; - box-shadow: @card-shadow; - cursor: pointer; -} - -.copy-block-view { - position: relative; - .copy-block-code { - display: inline-block; - margin: 0 0.2em; - padding: 0.2em 0.4em 0.1em; - font-size: 85%; - border-radius: 3px; - } -} diff --git a/src/components/CopyBlock/index.tsx b/src/components/CopyBlock/index.tsx deleted file mode 100644 index ccdda639..00000000 --- a/src/components/CopyBlock/index.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import { Icon, Popover, Typography } from 'antd'; -import React, { useRef } from 'react'; - -import { FormattedMessage } from 'umi-plugin-react/locale'; -import { connect } from 'dva'; -import { isAntDesignPro } from '@/utils/utils'; -import styles from './index.less'; - -const firstUpperCase = (pathString: string): string => - pathString - .replace('.', '') - .split(/\/|-/) - .map((s): string => s.toLowerCase().replace(/( |^)[a-z]/g, L => L.toUpperCase())) - .filter((s): boolean => !!s) - .join(''); - -// when click block copy, send block url to ga -const onBlockCopy = (label: string) => { - if (!isAntDesignPro()) { - return; - } - - const ga = window && window.ga; - if (ga) { - ga('send', 'event', { - eventCategory: 'block', - eventAction: 'copy', - eventLabel: label, - }); - } -}; - -const BlockCodeView: React.SFC<{ - url: string; -}> = ({ url }) => { - const blockUrl = `npx umi block add ${firstUpperCase(url)} --path=${url}`; - return ( -
- onBlockCopy(url), - }} - style={{ - display: 'flex', - }} - > -
-          {blockUrl}
-        
-
-
- ); -}; - -interface RoutingType { - location: { - pathname: string; - }; -} - -export default connect(({ routing }: { routing: RoutingType }) => ({ - location: routing.location, -}))(({ location }: RoutingType) => { - const url = location.pathname; - const divDom = useRef(null); - return ( - } - placement="topLeft" - content={} - trigger="click" - getPopupContainer={dom => (divDom.current ? divDom.current : dom)} - > -
- -
-
- ); -}); diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index f3c23110..596038a1 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -126,9 +126,6 @@ const BasicLayout: React.FC = props => { dispatch({ type: 'user/fetchCurrent', }); - dispatch({ - type: 'settings/getSetting', - }); } }, []); /** diff --git a/src/models/setting.ts b/src/models/setting.ts index c915eed0..22d9f384 100644 --- a/src/models/setting.ts +++ b/src/models/setting.ts @@ -5,7 +5,6 @@ export interface SettingModelType { namespace: 'settings'; state: DefaultSettings; reducers: { - getSetting: Reducer; changeSetting: Reducer; }; } @@ -21,23 +20,6 @@ const SettingModel: SettingModelType = { namespace: 'settings', state: defaultSettings, reducers: { - getSetting(state = defaultSettings) { - const setting: Partial = {}; - const urlParams = new URL(window.location.href); - Object.keys(state).forEach(key => { - if (urlParams.searchParams.has(key)) { - const value = urlParams.searchParams.get(key); - setting[key] = value; - } - }); - const { colorWeak } = setting; - - updateColorWeak(!!colorWeak); - return { - ...state, - ...setting, - }; - }, changeSetting(state = defaultSettings, { payload }) { const { colorWeak, contentWidth } = payload;