Skip to content

Commit

Permalink
add description for nested submenus and fix sidebar overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
azouaoui-med committed May 6, 2020
1 parent 9077f6f commit 6929d17
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 7 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- update readme : merge API tables into one single table
### Changed

- Update readme
- Merge API tables into one single table use prop instead of name
- Add description on how to use nested sub-menus

### Fixed

- Fix overflow of the sidebar content

## [0.1.0-beta.1] - 2020-05-06

Expand Down
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# [React Pro Sidebar](https://azouaoui-med.github.io/react-pro-sidebar)
# [React Pro Sidebar](https://www.npmjs.com/package/react-pro-sidebar)

[![npm][npm-image]][npm-url] [![License](https://badgen.net/npm/license/react-pro-sidebar)](https://www.npmjs.com/package/react-pro-sidebar)
[![npm][version]][npm-url]
[![License][license]][npm-url]
[![Peer][peer]][npm-url]

[npm-image]: https://img.shields.io/npm/v/react-pro-sidebar.svg?style=flat-square
[version]: https://img.shields.io/npm/v/react-pro-sidebar.svg?style=flat-square
[license]: https://img.shields.io/github/license/azouaoui-med/react-pro-sidebar?style=flat-square
[peer]: https://img.shields.io/npm/dependency-version/react-pro-sidebar/peer/react?style=flat-square
[npm-url]: https://www.npmjs.com/package/react-pro-sidebar

React sidebar library with dropdown menus and unlimited number of nested submenus
Expand Down Expand Up @@ -69,6 +73,21 @@ $icon-size: 35px;
@import '../node_modules/react-pro-sidebar/dist/scss/styles.scss';
```

## Using nested sub-menus

You can have as many nested menu-items and sub-menus as you like, and the syntax is very simple

```jsx
<Menu iconShape="square">
<SubMenu title="Components" icon={<FaGem />}>
<MenuItem>Component 1</MenuItem>
<SubMenu title="Sub Component 1" icon={<FaHeart />}>
{/* you can have more nested submenus ... */}
</SubMenu>
</SubMenu>
</Menu>
```

## Using React Router Dom

Here is an example on how to use [react router dom](https://github.com/ReactTraining/react-router) in the menu item
Expand All @@ -88,7 +107,7 @@ import { Link } from 'react-router-dom';
<thead>
<tr>
<th>Component</th>
<th>Name</th>
<th>Prop</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
Expand Down
1 change: 1 addition & 0 deletions demo/src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ body {
flex-grow: 1;
display: flex;
flex-direction: column;
overflow-y: auto;
header {
margin-bottom: 40px;
border-bottom: 1px solid #efefef;
Expand Down
2 changes: 1 addition & 1 deletion demo/src/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Layout({ setLocale }) {
const intl = useIntl();
const [rtl, setRtl] = useState(false);
const [collapsed, setCollapsed] = useState(false);
const [image, setImage] = useState(false);
const [image, setImage] = useState(true);

const handleCollapsedChange = (checked) => {
setCollapsed(checked);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-pro-sidebar",
"version": "0.1.0-beta.1",
"version": "0.1.0",
"description": "React sidebar library with dropdown menus and unlimit number of nested submenus",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down
1 change: 1 addition & 0 deletions src/scss/partials/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
text-align: left;
transition: width 0.3s;
position: relative;
overflow-y: auto;
> img.sidebar-bg {
width: 100%;
height: 100%;
Expand Down

0 comments on commit 6929d17

Please sign in to comment.