From 3a2f6bea1896cba4173a3a94d608ba09c392f884 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 19 Jun 2017 16:02:01 +0800 Subject: [PATCH] update menu demo --- .../__tests__/__snapshots__/demo.test.js.snap | 131 ++++++++---------- components/menu/demo/switch-mode.md | 51 ++++--- 2 files changed, 88 insertions(+), 94 deletions(-) diff --git a/components/menu/__tests__/__snapshots__/demo.test.js.snap b/components/menu/__tests__/__snapshots__/demo.test.js.snap index f29466ffeb..191f34d012 100644 --- a/components/menu/__tests__/__snapshots__/demo.test.js.snap +++ b/components/menu/__tests__/__snapshots__/demo.test.js.snap @@ -278,6 +278,20 @@ exports[`renders ./components/menu/demo/switch-mode.md correctly 1`] = ` class="ant-switch-inner" /> + Change Mode + + + + + Change Theme

    + +
  • @@ -299,10 +335,10 @@ exports[`renders ./components/menu/demo/switch-mode.md correctly 1`] = ` > - Navigation One + Navigation Three @@ -313,62 +349,33 @@ exports[`renders ./components/menu/demo/switch-mode.md correctly 1`] = ` role="menu" >
  • +
  • -
      - - -
@@ -381,33 +388,13 @@ exports[`renders ./components/menu/demo/switch-mode.md correctly 1`] = ` aria-owns="sub2$Menu" class="ant-menu-submenu-title" style="padding-left:24px;" - > - - - - Navigation Two - - - - -
  • - diff --git a/components/menu/demo/switch-mode.md b/components/menu/demo/switch-mode.md index fd46756de8..24ea7de1b3 100755 --- a/components/menu/demo/switch-mode.md +++ b/components/menu/demo/switch-mode.md @@ -15,52 +15,59 @@ Show the dynamic switching mode (between 'inline' and 'vertical'). ````jsx import { Menu, Icon, Switch } from 'antd'; -const SubMenu = Menu.SubMenu; -const MenuItemGroup = Menu.ItemGroup; +const { SubMenu } = Menu; class Sider extends React.Component { state = { mode: 'inline', + theme: 'light', } changeMode = (value) => { this.setState({ mode: value ? 'vertical' : 'inline', }); } + changeTheme = (value) => { + this.setState({ + theme: value ? 'dark' : 'light', + }); + } render() { return (
    - + Change Mode + + Change Theme

    - Navigation One}> - - Option 1 - Option 2 - - - Option 3 - Option 4 - - - Navigation Two}> - Option 5 - Option 6 - - Option 7 - Option 8 + + + Navigation One + + + + Navigation Two + + Navigation Three}> + Option 3 + Option 4 + + Option 5 + Option 6 - Navigation Three}> + Navigation Four}> + Option 7 + Option 8 Option 9 Option 10 - Option 11 - Option 12