From 233b4fb7740a7606e6491f9de979be812235ad29 Mon Sep 17 00:00:00 2001 From: "qixian.cs@outlook.com" Date: Thu, 7 Jun 2018 23:49:40 +0800 Subject: [PATCH] fix meun border style --- src/components/SiderMenu/SiderMenu.test.js | 24 ------------------- .../SiderMenu/{SiderMenu.js => SliderMenu.js} | 0 ...{SilderMenu.test.js => SliderMenu.test.js} | 2 +- src/components/SiderMenu/index.js | 2 +- src/components/TopNavHeader/index.js | 2 +- src/components/TopNavHeader/index.less | 8 +++++++ 6 files changed, 11 insertions(+), 27 deletions(-) delete mode 100644 src/components/SiderMenu/SiderMenu.test.js rename src/components/SiderMenu/{SiderMenu.js => SliderMenu.js} (100%) rename src/components/SiderMenu/{SilderMenu.test.js => SliderMenu.test.js} (95%) diff --git a/src/components/SiderMenu/SiderMenu.test.js b/src/components/SiderMenu/SiderMenu.test.js deleted file mode 100644 index 04b5b384..00000000 --- a/src/components/SiderMenu/SiderMenu.test.js +++ /dev/null @@ -1,24 +0,0 @@ -import { getMenuMatches } from './BaseMenu'; - -const menu = ['/dashboard', '/userinfo', '/dashboard/name', '/userinfo/:id', '/userinfo/:id/info']; - -describe('test menu match', () => { - it('simple path', () => { - expect(getMenuMatches(menu, '/dashboard')).toEqual(['/dashboard']); - }); - it('error path', () => { - expect(getMenuMatches(menu, '/dashboardname')).toEqual([]); - }); - - it('Secondary path', () => { - expect(getMenuMatches(menu, '/dashboard/name')).toEqual(['/dashboard/name']); - }); - - it('Parameter path', () => { - expect(getMenuMatches(menu, '/userinfo/2144')).toEqual(['/userinfo/:id']); - }); - - it('three parameter path', () => { - expect(getMenuMatches(menu, '/userinfo/2144/info')).toEqual(['/userinfo/:id/info']); - }); -}); diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SliderMenu.js similarity index 100% rename from src/components/SiderMenu/SiderMenu.js rename to src/components/SiderMenu/SliderMenu.js diff --git a/src/components/SiderMenu/SilderMenu.test.js b/src/components/SiderMenu/SliderMenu.test.js similarity index 95% rename from src/components/SiderMenu/SilderMenu.test.js rename to src/components/SiderMenu/SliderMenu.test.js index 8f01f669..b46b7cfa 100644 --- a/src/components/SiderMenu/SilderMenu.test.js +++ b/src/components/SiderMenu/SliderMenu.test.js @@ -1,5 +1,5 @@ import { urlToList } from '../_utils/pathTools'; -import { getFlatMenuKeys, getMenuMatchKeys } from './SiderMenu'; +import { getFlatMenuKeys, getMenuMatchKeys } from './SliderMenu'; const menu = [ { diff --git a/src/components/SiderMenu/index.js b/src/components/SiderMenu/index.js index 2c77fd84..d942591c 100644 --- a/src/components/SiderMenu/index.js +++ b/src/components/SiderMenu/index.js @@ -1,7 +1,7 @@ import 'rc-drawer/assets/index.css'; import React from 'react'; import DrawerMenu from 'rc-drawer'; -import SiderMenu from './SiderMenu'; +import SiderMenu from './SliderMenu'; /** * Recursively flatten the data diff --git a/src/components/TopNavHeader/index.js b/src/components/TopNavHeader/index.js index b6483864..1ca29ba3 100644 --- a/src/components/TopNavHeader/index.js +++ b/src/components/TopNavHeader/index.js @@ -16,7 +16,7 @@ export default class TopNavHeader extends PureComponent {

Ant Design Pro

- +
diff --git a/src/components/TopNavHeader/index.less b/src/components/TopNavHeader/index.less index 681c6ef7..44132fe8 100644 --- a/src/components/TopNavHeader/index.less +++ b/src/components/TopNavHeader/index.less @@ -5,6 +5,14 @@ padding: 0 12px 0 0; box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); position: relative; + :global { + .ant-menu-submenu.ant-menu-submenu-horizontal { + height: 100%; + .ant-menu-submenu-title { + height: 100%; + } + } + } &.light { background-color: #fff; } -- GitLab