Skip to content

Commit

Permalink
remove react-icons as a peer dependency (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwhiteley committed Aug 24, 2018
1 parent 6c2b5a9 commit 1c1c0bd
Show file tree
Hide file tree
Showing 9 changed files with 6,850 additions and 2,228 deletions.
2 changes: 1 addition & 1 deletion .babelrc
@@ -1,3 +1,3 @@
{
"presets": ["es2015", "react", "stage-0"]
"presets": ["env", "react", "stage-0"]
}
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -166,7 +166,15 @@ To see an example please see [example/LinkComponent.js](example/LinkComponent.js
You can fully customize the back link of the sub menus by passing in a React Component to this property.
It will be instantiated with the data object also passed in `onNodeClick` as a property (`this.props.data`).

**expanderComponent** (React.Component)
**backIcon** (React.Component)

If you don't specify a `backComponent`, you can at least need specify an icon to use for the back component

```js
<FaChevronLeft />
```

**expanderComponent** (React.Component) (Required)

You can fully customize the expander link of the sub menus by passing in a React Component to this property. The expander is the `chevron-right` that appears when a menu item has children.
It will be instantiated with the data object also passed in `onNodeClick` as a property (`this.props.data`).
Expand Down
6 changes: 4 additions & 2 deletions example/index.js
Expand Up @@ -6,7 +6,7 @@ import './demo.css';
import React from 'react'
import {render} from 'react-dom';
import PushMenu from '../src/index'
import Bars from 'react-icons/lib/fa/bars';
import {FaBars, FaChevronRight, FaChevronLeft} from 'react-icons/fa';

import Link from './LinkComponent';

Expand Down Expand Up @@ -47,6 +47,8 @@ class Page extends React.Component{
render(){
return (
<PushMenu
backIcon={<FaChevronLeft />}
expanderComponent={FaChevronRight}
onNodeClick={(e, {menu, node}) => {
console.log(node)
menu.tools.reset();
Expand All @@ -58,7 +60,7 @@ class Page extends React.Component{
propMap={{url: 'link'}}>

<div className="rpm-trigger" id="rpm-trigger" >
<Bars />
<FaBars />
</div>

</PushMenu>
Expand Down

0 comments on commit 1c1c0bd

Please sign in to comment.