Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ | |
] | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import ClassNames from 'classnames'; | ||
import style from './style'; | ||
import { themr } from 'react-css-themr'; | ||
import classnames from 'classnames'; | ||
|
||
const AppBar = (props) => { | ||
const className = ClassNames(style.root, { | ||
[style.fixed]: props.fixed, | ||
[style.flat]: props.flat | ||
const AppBar = ({ theme, ...props }) => { | ||
const className = classnames(theme.appBar, { | ||
[theme.fixed]: props.fixed, | ||
[theme.flat]: props.flat | ||
}, props.className); | ||
|
||
return ( | ||
|
@@ -19,7 +19,12 @@ AppBar.propTypes = { | |
children: React.PropTypes.node, | ||
className: React.PropTypes.string, | ||
fixed: React.PropTypes.bool, | ||
flat: React.PropTypes.bool | ||
flat: React.PropTypes.bool, | ||
theme: React.PropTypes.shape({ | ||
appBar: React.PropTypes.string.isRequired, | ||
fixed: React.PropTypes.string.isRequired, | ||
flat: React.PropTypes.string.isRequired | ||
}) | ||
}; | ||
|
||
AppBar.defaultProps = { | ||
|
@@ -28,4 +33,4 @@ AppBar.defaultProps = { | |
flat: false | ||
}; | ||
|
||
export default AppBar; | ||
export default themr('ToolboxAppBar')(AppBar); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
KerenChandran
Contributor
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ToolboxAppBar from '../components/app_bar/theme.scss'; | ||
|
||
export default { ToolboxAppBar }; | ||
This comment has been minimized.
Sorry, something went wrong.
KerenChandran
Contributor
|
1 comment
on commit c7f8d83
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, this method can be used in conjunction with react-toolbox-loader right? Like I can use the default style for the input field and have a different style (using this approach) for the textarea, but both will allow toolbox-loader to override default config variables right?
So I noticed that you are not including the default styles for the component, but are suggesting we use the ThemeProvider with a javascript file that imports all the base themes with the key matching the identifier for each component.