Skip to content

Commit

Permalink
feat: make Sider collapsible (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
orzyyyy committed Aug 25, 2019
1 parent c9861a5 commit 34faecd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class MainPage extends Component<MainPageProps, MainPageState> {
const { menuData } = this.props;
const { siderSelectedKey } = this.state;
return (
<Sider theme="light">
<Sider theme="light" collapsible collapsedWidth={0}>
<Menu
selectedKeys={[siderSelectedKey]}
mode="inline"
Expand Down
2 changes: 2 additions & 0 deletions src/pages/__tests__/__snapshots__/MainPage.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ exports[`MainPage render correctly 1`] = `
className="MainPage"
>
<Sider
collapsedWidth={0}
collapsible={true}
theme="light"
>
<Menu
Expand Down
4 changes: 4 additions & 0 deletions src/pages/css/MainPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@
background: #e6f7ff;
transition: background 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.MainPage .ant-layout-sider-zero-width-trigger {
top: calc(100vh - 65px);
}

0 comments on commit 34faecd

Please sign in to comment.