Migrate MenuDivider to themr

old
Javi Velasco 2016-05-22 20:46:40 +02:00
parent e20bae5e62
commit 54dca2d5cc
4 changed files with 19 additions and 15 deletions

View File

@ -1,8 +1,14 @@
import React from 'react';
import style from './style.menu_divider';
import { themr } from 'react-css-themr';
const MenuDivider = () => (
<hr data-react-toolbox='menu-divider' className={style.root}/>
const MenuDivider = ({ theme }) => (
<hr data-react-toolbox='menu-divider' className={theme.menuDivider}/>
);
export default MenuDivider;
MenuDivider.propTypes = {
theme: React.PropTypes.shape({
menuDivider: React.PropTypes.string.isRequired
})
};
export default themr('ToolboxMenu')(MenuDivider);

View File

@ -109,4 +109,4 @@ The inner component for menus and describes the content of each option. It behav
## Menu Divider
A very simple component that just displays a separator between options. It has no props and no state or methods, just markup.
A very simple component that just displays a separator between options. It has no props and no state or methods, just markup. Also it accepts a single class for the styling which is `menuDivider`.

View File

@ -1,10 +0,0 @@
@import "../base";
@import "./config";
.root {
display: block;
width: 100%;
height: 1px;
margin: $menu-divider-height 0;
background-color: $color-divider;
}

View File

@ -142,3 +142,11 @@
.shortcut {
margin-left: $menu-item-padding;
}
.menuDivider {
display: block;
width: 100%;
height: 1px;
margin: $menu-divider-height 0;
background-color: $color-divider;
}